views:

37

answers:

2

I'm in need of a way to serve either HTML or links to external webpages. Basically what needs to be done is we will have webpages, and then would like to give a user of our site a URL or piece of javascript to insert into their own page, which will then display our HTML on their page upon load.

Can somebody please guide me in the right direction?

Thanks!

+4  A: 

What you appear to need is the iframe tag.

Andrew Barber
Thank you, Andrew B. Are you aware of any problems that may arise out of the use of an IFrame? I.e, do some browsers not support them anymore, or not support them properly?
iframes are pretty much completely supported by all modern, desktop browsers. Just like many other tags, there are occasional quirks in how they will display in one browser or another. But also keep in mind that you may run into users who have security-related troubles from loading content in multiple sites; over-enthusiastic browser plugins trying to protect against cross-site scripting, for example. But that's going to apply with any appropriate solution.
Andrew Barber
Hehehe, thanks! :)
A: 

You could use javascript to pull the content from your site

<script src="http://youdomain.com/mycontent.js"&gt;
</script>

then in your js file use

var myhtml ='';

myhtml += "Put your html in here";
document.write(myhtml);
cfEngineers