www.webdeveloper.com
Page 3 of 3 FirstFirst 123
Results 31 to 34 of 34

Thread: One js script is blocking every js on the page. Why ???

  1. #31
    Join Date
    Nov 2002
    Location
    Milan, MI
    Posts
    152
    Yah, there's somewhat of a delay in both browsers. But there's a lot of stuph getting downloaded, too; and I notice that the delay goes away on subsequent hits to the page. So, I would guess the problem is mainly just in the amount of stuph the browser has to initially retrieve/parse. Once it's in the cache it's fine.

    If you want to pursue it, you might just re-inventory to make sure that all the stuph you're loading (esp. JavaScripts) is really necessary on the FP. If not, perhaps some of it could be moved to inner pages, or at least to the bottom of the FP so that the page can theoretically be visible while they're loading.

    One other immediate thought: Since you're using conditional logic for IE, you could include the alternate stylesheet block in the reverse condition, to ensure that IE won't try to redownload the same set of sheets. I.E.,
    Code:
    <!--[if !IE]>blah blah blah
    Good luck!
    Dan

  2. #32
    Join Date
    Aug 2004
    Location
    Switzerland
    Posts
    1,101
    Hey, thanks ! That might be really usefull, indeed.
    Something that I just notice (I'm not at home so I can't try any modification right now) is that no stylesheet is downloaded in Safari. It just returns the page without any styling. Do you know if something is messing up with Safari ? I thought the browser was acting like firefox, but apparently it's not

  3. #33
    Join Date
    Feb 2006
    Posts
    198
    it is usually a good idea to plase js code at end of page to allow page to at least fully display

  4. #34
    Join Date
    Nov 2002
    Location
    Milan, MI
    Posts
    152
    Some browsers won't recognize style sheet switches until after you've directly set the disabled property via JavaScript. So, add an extra changeLayout call with no sheet designation just before your first dynamicLayout call to force all the non-default sheets to disabled:
    Code:
       changeLayout('');
       dynamicLayout();
       addEvent(window, 'load', dynamicLayout);
       addEvent(window, 'resize', reloading);
    BTW, are you sure the conditional logic for IE is necessary? In my testing I found that IE seemed to work fine with the alternate stylesheets. Here's a reduction I was working with this morning:

    http://biblestuph.com/experiments/switch/

    which seems happy in FF (2/3), Safari (3.2.1/Win), IE (6/7) and Opera (9.5.2).

    Also, here's a tut that discusses several style-sheet switching issues in general:
    http://www.howtocreate.co.uk/tutoria...ascript/domcss

    Oh, and forget what I said yesterday about enclosing the other alternate sheets in a non-IE conditional block. Fine for IE browsers, but will screw up everything else, of course...

    Good luck!
    Last edited by dragle; 12-12-2008 at 10:49 AM. Reason: added conditional IE qualification
    Dan

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles