1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

help with javascript

Discussion in 'Software Development' started by malice, Sep 13, 2003.

Thread Status:
Not open for further replies.
Advertisement
  1. malice

    malice Thread Starter

    Joined:
    Jun 18, 2003
    Messages:
    56
    hi i have this javascript which is supposed to show a series of images on my site

    this is the code:


    <script language="javascript">
    -->
    // Set speed (milliseconds)
    var speed = 900

    // Specifying image files
    var Pic = new Array()

    img[0] = '0.jpeg'
    img[1] = '1.jpeg'
    img[2] = '2.jpeg'
    img[3] = '3.jpeg'

    var t
    var j = 0
    var p = Pic.length

    var preLoad = new Array()
    for (i = 0; i < p; i++){
    preLoad = new Image()
    preLoad.src = Pic
    }

    function runimgs(){
    if (document.body){
    document.body.background = Pic[j];
    j = j + 1
    if (j > (p-1)) j=0
    t = setTimeout('runimgs()', speed)
    }
    }
    // End -->
    </script>

    in my body tag theres also the onload="runimgs()"

    but i always get an error msg saying object expected
    can anyone tell me whats wrong?
     
  2. brendandonhu

    brendandonhu

    Joined:
    Jul 8, 2002
    Messages:
    14,681
    Can you post a link to the page having this problem?
     
  3. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    Are the images in your array actual images on your web site? Might just be a path problem to the image files.
     
  4. malice

    malice Thread Starter

    Joined:
    Jun 18, 2003
    Messages:
    56
    nope no problem with path or anything

    i wish i could but currently my isp is giving me a hard time
    and denied access to the free webspace i have
    so i cant do it online its strange i couldnt find any mistake
    in this and apparently neither can you.
    hmmm 'scratches head'
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/164493

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice