...

View Full Version : getting "object required" errors in IE



crazygamer
09-18-2005, 07:23 PM
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

coothead
09-18-2005, 08:04 PM
Hi there crazygamer,

you have a syntax error, which I have highlighted...


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

crazygamer
09-18-2005, 08:16 PM
Oops :eek:, 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.

coothead
09-18-2005, 08:32 PM
Hi there crazygamer,

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

coothead

crazygamer
09-18-2005, 08:50 PM
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.

crazygamer
09-18-2005, 09:22 PM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum