The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Lol...mike means...if you are going to load a full html page in it, use iframe, if you just want to assign some content to a container, then set oDiv.innerHTML = "something". oDiv here is the name/id of your div, or a variable that got the correct div assigned to it in an earlier stage.

Lol...mike means...if you are going to load a full html page in it, use iframe, if you just want to assign some content to a container, then set oDiv.innerHTML = "something". oDiv here is the name/id of your div, or a variable that got the correct div assigned to it in an earlier stage.

Well..my own solution to this stuff is generally use of both iframes and divs. You can set up a central way to asynchronously retrieve data with javascript by making a function that will accept an url to retrieve, then call a callback function.

You set a hidden iframe up somewhere in the page, and just let the function set the url of the iframe, containing the name of the function to call. The server side script then generates the returning page, including a javascript that will call the callback function after the onLoad event of the body.

The callback function in his turn, will read the contents of the iframe, and do something useful with it (for example copy the results to some div on the page in proper formatting). Works in about any browser (since a variant is also available in the form of a 0 pixel wide frame in a frameset), as long as the browser supports basic javascript support.

The benefit of going about it this way is you have a handy component that will bring this functionality to any site you copy it to, ready to use. Also div's are a bit more flexible than iframes in my opinion, actually...I myself loath using visible iframes. Making it even more portable you might consider cutting out the need for the info page to contain javascript, and just let the calling function check wether a new page has been loaded into the iframe yet. (Consider setting the iframes content to 'loading' or something)