Web Analytics Made Easy -
StatCounter Page Load Script ... - CodingForum

Announcement

Collapse
No announcement yet.

Page Load Script ...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Page Load Script ...

    I want a page loading script that will load javasript files, WAV files, and other web documents, not just image files.

    I am currently using an image loading script contained in a separate HTML file that loads predefined images and then loads a specified URL. It requires two 1x1 pixel image files named "blue.gif" and "black.gif."

    I want the script contained in a separate HTML document to avoid script conflicts with my main page.

    Thanks a bunch,
    Jason.


    Here is my code:

    <html>
    <head>
    <title>Page Loading...</title>

    <LINK REL=StyleSheet HREF="style13.css" TITLE="Style13" TYPE="text/css">

    <script language="JavaScript">
    <!--
    vers = 1.0;
    // -->
    </script>
    <script language="JavaScript1.1">
    <!--
    vers = 1.1;
    // -->
    </script>
    <script language="javascript">
    <!--
    function initArray() {
    for (var i = 0; i < initArray.arguments.length; i++)
    this[i] = initArray.arguments[i];
    this.length = initArray.arguments.length;
    }
    var pics = new initArray(
    "Image1.gif",
    "Image2.gif",
    "Image3.jpg",
    "Image4.jpg");

    var transfer_url = "index2.html"; // URL of second page goes here

    function transfer(param) {
    if (vers>1.0)
    location.replace(transfer_url);
    else
    location.href = transfer_url;
    }

    function done() {
    if (vers < 1.1)
    transfer();
    else
    commence_loading();
    }

    function commence_loading() {
    for (g=0;g<pics.length;g++)
    eval('document.preload'+g+'.src = "'+pics[g]+'";');
    }

    // preload the status bar images
    if (vers >= 1.1) {
    blue = new Image();
    blue.src = "blue.gif";
    black = new Image();
    black.src = "black.gif";
    }

    var loaded = new Object();
    for (h=0;h<pics.length;h++)
    loaded[h] = 0;
    num_loaded = 0;

    function update(num) {
    loaded[num]++;
    if (loaded[num] == 2) {
    eval('document.status'+num_loaded+'.src = "blue.gif";');
    num_loaded++;
    if (num_loaded == pics.length)
    transfer();
    }
    }
    // -->
    </script>


    </head>







    <body onLoad="done()">

    <center>
    <br><br><br><br>
    Page Loading...
    <br><br>

    <script language="JavaScript">
    <!--
    if (vers < 1.1) {
    document.write('What a pitiful browser you have! Get Netscape 3 or above to see<br>'
    + 'all the great stuff on this site');
    for (j=0;j<pics.length;j++) {
    document.write('<img src="'+pics[j]+'" width=1 height=1>');
    }
    } else {
    document.write('<table><tr><td> '
    + '<img src="blue.gif" width=40 height=20>');
    for (k=0;k<pics.length;k++)
    document.write('<img src="black.gif" width=50 height=20 name="status'+k+'">');
    document.write('</td></tr></table><br>'
    + '<a href="'+transfer_url+'">I can\'t wait</a>');
    for (j=0;j<pics.length;j++) {
    document.write('<img src="black.gif" width=1 height=1 '
    + 'onLoad="update('+j+')" name="preload'+j+'">');
    }
    }
    // -->
    </script>

    </center>

    </body>
    </html>

  • #2
    Anybody?

    Comment


    • #3
      I need page Loading javascript

      Hi there....

      I need page Loading javascript so please send me page loading javascript it's very urgently.

      I used below Javascript for Page Loading but this js is not loading for all pages and browser.

      <script type="text/JavaScript">
      <!--
      function MM_openBrWindow(theURL,winName,features) { //v2.0
      window.open(theURL,winName,features);
      }
      //-->
      </script>
      <SCRIPT LANGUAGE="JavaScript">

      function PageFinished( ) {

      if (document.images) {

      img1 = new Image();

      img1.src=

      "http://www.abc123.com/images/top-main-navigation/logo.png";

      }

      }

      </SCRIPT>


      so please send me URGENTLY.

      Kindly waiting your reply.

      Thanks
      Niraj
      Last edited by nirajprajapati; Oct 30, 2006, 04:41 AM. Reason: wrong message

      Comment


      • #4
        I need Page Loading Script

        fdafas

        Comment

        Working...
        X