+ Reply to Thread
Results 1 to 1 of 1

Thread: JavaScript Help

  1. #1
    Cynical's Avatar
    Cynical is offline Lord Of The Keys Cynical is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Massachusetts, USA
    Posts
    1,746

    JavaScript Help

    I found a snippet of JS code on some website and I'm trying to mold it into something I can use. Unfortuntely, only half the script works. The script is supposed to count 1... 2... 3... etc. (at least for now, I have other intentions later), but it returns an error in IE (stops in Opera) when switching from 2 to 3. IE says "Object expected" on line 1 character 1. Here's the code for the entire page:
    Code:
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    
    function makeArray(q) {
      for (i=1; i < q; i++) {
        this[i]=0
      }
    }
    w = 1;
    count = 4;
    
    txt = new makeArray(count);
    wait = new makeArray(count);
    
    txt[1] = "1";
    txt[2] = "2";
    txt[3] = "3";
    txt[4] = "4";
    wait[1] = 1000;
    wait[2] = 1000;
    wait[3] = 1000;
    wait[4] = 1000;
    
    function showSites() {
      if (w > count) {
         w = 1;
      };
      var string = txt[w];
    
      document.write(string);
      window.setTimeout('showSites()',wait[w]);
      w += 1;
    }
    
    // End -->
    </SCRIPT>
    </head>
    
    <BODY>
    <script>
    showSites();
    </script>
    Any help getting it to work would be greatly appreciated... I hardly know any javascript myself.

    EDIT: Solved, it was an array issue.
    Last edited by Cynical; 04-18-2006 at 05:52 PM.
    Seven: This rule is so underrated, keep your family and business completely separated.

+ Reply to Thread

Similar Threads

  1. javascript and css in php
    By TarinC in forum Scripts & 3rd Party Apps
    Replies: 12
    Last Post: 04-01-2006, 05:44 PM
  2. javascript
    By Brandon in forum Off Topic
    Replies: 6
    Last Post: 01-20-2006, 04:49 PM
  3. Javascript Compiler
    By S_W_A_T in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 08-01-2005, 05:31 PM
  4. [PHP] Placing the Ads in PHP Pages
    By Chris in forum Tutorials
    Replies: 22
    Last Post: 06-04-2005, 11:14 PM
  5. Having trouble with a javascript block...
    By oab in forum Scripts & 3rd Party Apps
    Replies: 0
    Last Post: 05-31-2005, 05:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers