Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I display popup message while a large JavaScript file is loading

    My problem is that I have a large application written in HTML and JavaScript, about 6,500 lines of source and the web site file is protected (using HTML-protector.com) and is 1,515 KB Users at slow connect speeds are experiencing significant delay while file loads into their IE browser.

    The problem is that I can get a popup loading message to display, but only after user has been waiting with a blank screen for too long.

    I have tried without success several suggested scripts to display a “Loading … please wait” message. Currently I have the following:

    At line 7 of file :

    MyPopup is the loading “Please wait – message”
    var theURL = 'Loading_message_popup.html';
    var width = 700;
    var height =300;
    MyPopup = window.open('Loading_message_popup.html','newWindow','toolbar=no,menubar=no,resizable=no,scrollbars= no,status=no,location=no,width='+width+',height='+height);
    </script>

    </HEAD>
    <BODY onLoad="MyPopup.close();">
    <script language="JavaScript">

    Then follows the remaining 6500 lines of the script. The popup only displays after a long time waiting with a white screen at dialup speed using IE browser.

    I am starting to wonder, because of the size of the script file involved, if there is any way I can get a popup message to display while the script is being sent from the server. I would appreciate any comments or suggestions, or alternative ways to display a popup while a large script file is downloading.

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    1. Popup blockers will block the popup from appearing as it is not being created from a user action.

    2. HTML-protector is a waste of money. The decrypted source can easily be obtained by either saving the page with Netscape 7.0 or using a view source userscript.

    3. 80k is a huge web page (that will lose 50% of visitors before it loads), your page is so large you are losing 99.9999999% of your visitors before the page finishes loading.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

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