Garayed.com  

Go Back   Garayed.com > HTML
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-02-2008, 05:59 PM
acw
 
Posts: n/a
Default Automatic tag variables in IE

I am trying to understand how IE handles automatic tag variables.

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
references.


In most cases if you remove the duplicate tag the global var becomes
a
tag reference again. Other times it remains a collection but with
only
one element.


Getting completely away from using the automatic variables is not an
option. So, I am trying to understand how the variables are handled
by
IE. Does anyone know what determines whether the global variable is
reverted to a tag reference or left as a collection when the
duplicate
tags are removed from the page?


================================================== ==========


For example, if we start with
..
<div id="container1"></div>
<div id="container2"></div>
..


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[0] points to the first span.


TIA!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:00 AM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.