Results 1 to 5 of 5

Thread: preload all script library before UI appear?

  1. #1

    Default preload all script library before UI appear?

    Hi Jack,
    Is there a way to do preload all the script library before the UI actually display? I think the YUI library size is pretty big ..it would be nice to let the user know the browser is currently download the library or associated files. Thanks

    KN

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956

    Default

    You can create an element with a position:absolute; left: 0px; top: 0px; background-color:white; width:100%;height:100%;z-index:50000; and put it at the very top of the body. In that element put another positioned element in the middle that says loading or whatever and has your fav animated loading icon.

    After this element, put your script includes.

    When the page loads and you initialize your app:

    var loading = document.getElementById('loading-id');
    loading.parentNode.removeChild(loading);

    and you are ready to go.

  3. #3

    Default

    Thanks

  4. #4

    Default

    well if you include the javascript in the head section of an html document... youll not be able to use this because the user cannot see any output before the complete YUI files have been transfered to the client...

    You have to include it inline in the body section ...
    [script type="text/javascript" src="plugin/yui/build/yahoo/yahoo.js"></script]
    ...

  5. #5
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956

    Default

    You are right Hors, that's why I said "After this element, put your script includes.".

Similar Threads

  1. iframe + script loading
    By Choleriker in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 15 Jun 2011, 4:14 PM
  2. how add script reference?
    By skyey in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 13 Mar 2007, 6:05 PM
  3. Help wanted, with script
    By ahoekie in forum Ext 1.x: Help & Discussion
    Replies: 6
    Last Post: 16 Feb 2007, 12:14 AM

Posting Permissions

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