'(object reference)' is null or not an object

By M.J ยท 4 replies
May 15, 2005
  1. hi

    i am using a code to view some pictures .. and it work fine with me ..


    when i use the same code to view an other set of pictures this error appears

    '(tdiv.style.left)' is null or not an object

    how can i prevent that error ..

    i want to use that code more than once in my page

    can u help me plz ?


    i took my code from this link:

  2. RealBlackStuff

    RealBlackStuff TS Rookie Posts: 6,503

    That script looks rather convoluted.
    On first glance, I'd say you may have to initialise i again when you use that routine a second or third time.
    Alternatively, turn it into a separate javascript, e.g. slideshow.js that you can call up, using different sets of pictures.
  3. M.J

    M.J TS Rookie Topic Starter

    i will try that ....

    thanks 4 ur reply :)
  4. M.J

    M.J TS Rookie Topic Starter

    i tried what u just said but it didn't work and i still have the same problem..

    i attach a zip file to this Thread

    * test.html

    (it view 1 set of pictures and it is working fine .. this code call 4 java script file)

    * code1.js

    * code2.js

    * code3.js

    * code4.js

    * p1.jpg

    * p2.jpg

    * p3.jpg

    * p4.jpg


    if i duplicate the code in the file test.html in order to have 2 set of pictures with the same animation .. i am going to have this errore :
    '(tdiv.style.left)' is null or not an object


    i hope this information can help u to fix that error
  5. RealBlackStuff

    RealBlackStuff TS Rookie Posts: 6,503

    When I duplicate that code, a second picture shows under the first moving lot.
    The second picture does not change, it remains fixed on the red sunset.
    No errors however.

    My PC does not have MS Java, I uninstalled that and put Sun Java JRE on instead.
    That might be the reason.
    You'll have to experiment yourself with this, I don't have the time I'm afraid.
Topic Status:
Not open for further replies.

Similar Topics

Add your comment to this article

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...