469,934 Members | 1,847 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,934 developers. It's quick & easy.

AJAX Problem - Firefox and IE6 issue

I have just put 4 different ajax bits on this page:
http://jimpix.co.uk/default-ajax.asp

The ajax spits out chunks of images / news content, and users can view
the chunks via next / prev links.

When I first view the page in Firefox, there is a short delay while
the content first loads in the ajax sections.

When I first view the page in IE6, none of the ajax content appears to
start with. It only appears if I click a 'next' link.

Initially the body tag contained this, to fire off the 4 relevant
functions:
<body id="root" onload="sendRequest(MyCurrentVar + ',' +
MyCurrentCat); sendPhotoRequest(MyPhotoVar);
sendNewsRequest(MyNewsVar); sendWPRequest(MyWPVar)">

I then got rid of that, and used this instead:

window.onload = function()
{
sendRequest(MyCurrentVar + ',' + MyCurrentCat)
sendPhotoRequest(MyPhotoVar)
sendNewsRequest(MyNewsVar)
sendWPRequest(MyWPVar)
}

But I get the same result regardless.

Any advice much appreciated.

Thanks

Mar 12 '08 #1
1 1674
VK
On Mar 12, 9:06 pm, violinandvi...@fastmail.fm wrote:
I have just put 4 different ajax bits on this page:http://jimpix.co.uk/default-ajax.asp

The ajax spits out chunks of images / news content, and users can view
the chunks via next / prev links.

When I first view the page in Firefox, there is a short delay while
the content first loads in the ajax sections.

When I first view the page in IE6, none of the ajax content appears to
start with. It only appears if I click a 'next' link.

Initially the body tag contained this, to fire off the 4 relevant
functions:
<body id="root" onload="sendRequest(MyCurrentVar + ',' +
MyCurrentCat); sendPhotoRequest(MyPhotoVar);
sendNewsRequest(MyNewsVar); sendWPRequest(MyWPVar)">

I then got rid of that, and used this instead:

window.onload = function()
{
sendRequest(MyCurrentVar + ',' + MyCurrentCat)
sendPhotoRequest(MyPhotoVar)
sendNewsRequest(MyNewsVar)
sendWPRequest(MyWPVar)

}

But I get the same result regardless.

Any advice much appreciated.
Are these send*Request sync or async? Do not forget that the page is
not displayed until the first execution break in onload handler. If
onload one starts a long operation, it may take a lot of time before
the initial blank screen will be repainted by the actual content. I am
not saying that it is your problem but it is a very often problem for
many current script-intensive sites. In my solution I am always using
onload over overlay to release the context so to let the page to be
initially drawn:

<script type="text/javascript">

function init() {
// do your stuff
}

function releaseContextAndInit() {
window.setTimeout('init()',10);
}

window.onload = releaseContextAndInit;
</script>

P.S. That excludes situations when one indeed doesn't want to display
the page until all its content is fully prepared.
Mar 12 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by Arjen | last post: by
2 posts views Thread by germ | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.