AJAX Problem - Firefox and IE6 issue

V

violinandviola

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
 
V

VK

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,765
Messages
2,569,568
Members
45,042
Latest member
icassiem

Latest Threads

Top