SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast Coolk Da Man's Avatar
    Join Date
    Sep 2002
    Location
    Tenerife
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    object is undefined error

    Hi guys

    I am working on a site and have put some javascript in to control the size of the image that gets displayed on the page, however it runs ok but always returns an error after loading, and I can't find a cause.

    I would appreciate it if anybody could shed some light on this or point me in the right direction.

    the url of the page that has the error is:
    http://www.horizonpropertyrentals.co...view.asp?aid=1

    thanx in advance

    ck
    Karl Snares
    Lead Programmer
    www.sortedsites.com
    www.sortedsites.info

  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's this line

    window.setTimeout("makeFit("+theImg+","+maxW+", "+maxH+")",1000)

    You're losing scope for the local variable. Do this instead

    window.setTimeout( function() { makeFit( theImg, maxW, maxH ) }, 1000 )

    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev





Bookmarks

Posting Permissions

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