SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Dec 2004
    Posts
    419
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    AJAX Problem - Firefox and IE6 issue

    I have just put 4 different ajax bits on this page. 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.

    Looking at the HTML, I think the problem is in this section:

    HTML Code:
    <body id="root" onload="sendRequest(MyCurrentVar + ',' + MyCurrentCat); sendPhotoRequest(MyPhotoVar); sendNewsRequest(MyNewsVar); sendWPRequest(MyWPVar)">
    If I replace it with, e.g.:

    HTML Code:
    <body id="root" onload="sendRequest(MyCurrentVar + ',' + MyCurrentCat);>
    Then the 12 ecard images appear in IE.

    I just tried this instead:

    HTML Code:
    <body id="root" onload="LoadThemAll()">
    and then this in the javascript:

    Code JavaScript:
    function LoadThemAll() {
    	sendRequest(MyCurrentVar + ',' + MyCurrentCat);
    	sendPhotoRequest(MyPhotoVar);
    	sendNewsRequest(MyNewsVar);
    	sendWPRequest(MyWPVar)
    }

    But in IE, the only function that fires, is the last one, so only the wallpaper section displays...

    Does IE not support the multiple onload in the body tag?

    Thanks
    Last edited by bumpyride; Mar 12, 2008 at 08:47.

  2. #2
    SitePoint Guru Ruben K.'s Avatar
    Join Date
    Jun 2005
    Location
    Alkmaar, The Netherlands
    Posts
    693
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why don't you use javascript onload event?

    Code:
    window.onload = function()
    {
       // do stuff here
    }

  3. #3
    SitePoint Evangelist
    Join Date
    Dec 2004
    Posts
    419
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply.

    I have done this:

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

    This is the result - when first viewed in Firefox - no ajax content is displayed. So I get the same in Firefox and IE using this method...

    Thanks

    Jim
    Last edited by bumpyride; Mar 12, 2008 at 08:52.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •