Do you have a question? Post it now! No Registration Necessary. Now with pictures!
July 2, 2008, 5:59 pm
rate this thread
I know that IE will create a global variable each time it finds a tag
with its name or id attribute set. If you have more than one tag with
the same name or id (yes this is bad) on a page then that global
variable goes from being a tag reference to being a collection of
In most cases if you remove the duplicate tag the global var becomes
tag reference again. Other times it remains a collection but with
Getting completely away from using the automatic variables is not an
option. So, I am trying to understand how the variables are handled
IE. Does anyone know what determines whether the global variable is
reverted to a tag reference or left as a collection when the
tags are removed from the page?
For example, if we start with
then do ...
container1.innerHTML = "<span id='sometext'>some text</span>"
container2.innerHTML = "<span id='sometext'>some more text</span>"
The global var sometext is a collection with two elements.
If we do the following
container2.innerHTML = ""
The global var sometext is usually pointing to the first span. Other
times is a collection and sometext points to the first span.
- » Re: stellenangebot siemens Biologe Biologin IT-Systemkauffrau IT-Systemkaufmann Meteorolo...
- — Previous thread in » HTML Markup Language