This is a discussion on "Confusion between DOM element and javascript object" within the JavaScript Forum section. This forum, and the thread "Confusion between DOM element and javascript object are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Confusion between DOM element and javascript object
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Confusion between DOM element and javascript object
Hi,
I am having this really strange issue and would result in a javascript error popup in Internet Explorer. When I debug into the script, the problem seems to be that during the execution of some javascript code, IE confused a javascript object with a DOM element (A div). The code that is causing this issue is below:
|
|
|
|
#2
|
||||
|
||||
|
Re: Confusion between DOM element and javascript object
It's very hard to see what could be causing this without seeing the _SPlitter class and remaining code.
Are you able to post that?
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#3
|
|||
|
|||
|
Re: Confusion between DOM element and javascript object
IE makes everything with an id attribute a global variable.
thus if your class generates and adds a div, with that ID, it will be the object that IE refers to, instead of your class instance. I would *HIGHLY* recommend that in IE you *NEVER* use a variable name with the same label, as an element in your DOM (by ID or by NAME) (IE has issues with both!) Quote:
|
|
#4
|
|||
|
|||
|
Re: Confusion between DOM element and javascript object
Unfortunately, the code I showed above is from a third-party tool (ComponentArt) so I do not have any controls over how their javascript objects are created. I may need to take this up with their support then.
But I still do not understand why does it works most of the time? If what you said is correct, shouldn't it breaks all the time? But this error only pops up once every 10 times or something. And once it works, it will always works, until I restart IIS. |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Advice on obtaining an object using javascript. | Higel | JavaScript Forum | 1 | May 27th, 2008 18:05 |
| Javascript Copy to clipboard Object Error | andrewlondon | JavaScript Forum | 1 | Sep 24th, 2007 13:15 |
| Yet more confusion | dhall | Starting Out | 7 | Aug 20th, 2007 23:25 |
| element specific javascript | gumbo | Web Page Design | 0 | Dec 4th, 2005 23:27 |
| XHTML Block Element in an Inline Element | gohankid77 | Web Page Design | 6 | Jul 27th, 2004 10:15 |