Hi,

Really new to AJAX, attempting to load the first page content into a div on the website loading using an onLoad property to the body tag .

This is working in FF but not in IE7. Any help much appreciated!

Thanks

Gail. (http://www.pure-connections.com)

Hi.

The onload event and the AJAX code it executes looks like it's working fine.

The problem is that the onload event is not triggered until everything on the page has been loaded and the JavaScript in your "layer18" <div> appears not to be working as it should. In IE it just seems to freeze, preventing the page from loading completely. So the onload even is never triggered.

That JavaScript appears to be loading a flash movie.
Try replacing it with something like:

<object 
	type="application/x-shockwave-flash" 
	data="WEBSITE/logo.swf" 
	width="293" height="110"> 
	<param name="movie" value="WEBSITE/logo.swf" /> 
	<param name="quality" value="high"/> 
	<p>No flash player!</p> 
</object>

You can replace the <p> in there with whatever you want loaded in case the browser doesn't support flash.

Hi,

Thanks for your quick repsonse!

I have removed the "layer18" div but the onload event still doesnt seem to be triggering in IE7? It is still working perfectly in Firefox

That's weird.

I tried this on my private server. Copied all your code there and tested in all browsers... They all worked without any problems.
But the same code on your server doesn't work. :-/

The only thing I see wrong in the code is that the onLoad event should be spelled all lower-case, but that shouldn't be causing this sort of a problem.

It's almost like IE is expecting more data.
Perhaps you could try setting the "Connection: close" header at the top of the page. If you server can handle PHP that would be easy.

But if all else fails, you could always just add a <script> block right before you close the </body> that does what the onload is supposed to do... it's not pretty but it will definitely work.

Ahh no ok I figured it out :)
It's your welcome.html page. It does get loaded, but it's rendered *incorrectly*.

You are adding the entire content of that page into the current page, and because the included page also contains <html>, <body> and <style> tags, IE won't parse it correctly.

You need to change that. Add the styles in the welcome page to the global index.css file and remove the <html> - <body> tags, so that the welcome file only contains the markup you need added into the current page.

Hi Atli,

Thank you so much for your help.

Going to try that, will let you know!

Cheers

Gail

Just one little last thing! I have uploaded the content for the aromatherapy massage link. Is it appearing and then shifting into position to the left to you?

I want it to appear in exactly the position it should without having to shift over, if that makes any sense?

I'm not sure there is much you can do about that. That's probably just a quirk in the browser while it is rendering the new content.

But, just as with your welcome page, this page has all the <html>, <body> and <style> tags, which will probably cause some rendering issues as well.
Try removing them, see if that solves it.

If it doesn't, you could always try to hide the container <div> and have it appear a few milliseconds after the page loads. That should give the browser time to render it before it is displayed, which would get rid of the "sliding" motion.

This article has been dead for over six months. Start a new discussion instead.