Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Sep 2005
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    getting "object required" errors in IE

    I can't for the life of me find why this is happening. In the last 4 functions in the .js file IE keeps throwing me an error. I've checked and am 99% sure that only the right objects are getting passed to the functions. Could someone take a look, maybe find what's wrong with my code?

    Source:
    http://www.reallycoolspace.com/rearrange.html
    http://www.reallycoolspace.com/rearrange.js

  • #2
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,695
    Thanks
    0
    Thanked 232 Times in 227 Posts
    Hi there crazygamer,

    you have a syntax error, which I have highlighted...
    Code:
    
    function decorDragLeft(divToDecor) {
    	divToDecor.style.borderLeft = "3px solid blue";
    	divToDecor.firstChild.style.width = "83px";
    	divToDecor.style.width = "87px";
    	divToDecor.decor = "dragLeft";*/
    }
    
    ...remove that and see if that provides a cure.

    coothead

  • #3
    New Coder
    Join Date
    Sep 2005
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oops , thanks for pointing that out. However, the problem is still there and that "*/" was just from me commenting stuff out and playing with it to get it to work.

  • #4
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,695
    Thanks
    0
    Thanked 232 Times in 227 Posts
    Hi there crazygamer,

    you have not, as yet, removed the */ from your script.
    I suggest that you do so right away, so that the problem may be further investigated.

    coothead

  • #5
    New Coder
    Join Date
    Sep 2005
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry, updated in on my computer, forgot to FTP it to the server. Should be fixed now (and still not working).

    I've looked through my script a few more times and still can't find the problem. I do know that it's in the last 4 functions though because when I comment them out IE stops throwing the errors.

  • #6
    New Coder
    Join Date
    Sep 2005
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I solved it!

    The function that was throwing the error need a check if the "firstChild" of the element existed (if(!myDiv.firstChild) return.

    thanks for the help


  •  

    Posting Permissions

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