Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Javascript / Client Side Development

FAQ Topic - Why doesn't the global variable "divId" always refer to the element with id="divId"?


-----------------------------------------------------------------------
FAQ Topic - Why doesn't the global variable "divId" always
refer to the element with id="divId"?
-----------------------------------------------------------------------

Microsoft introduced a shortcut that can be used to reference
elements which include an ID attribute where the ID becomes a
global variable. Some browsers reproduce this behaviours but
some, most notably Gecko-based browsers (Netscape and Mozilla),
do not. The best approach is the ` document.getElementById `
method, which is part of the W3C DOM standard and implemented
in modern browsers (including IE from version 5.0). So an
element with ` id="foo" ` can be referenced
with:-

var el = document.getElementById("foo");

http://developer.mozilla.org/en/docs/Using_Web_Standards_in_your_Web_...

http://www.jibbering.com/faq/faq_notes/faq_notes.html#FAQN4_41

===
 Postings such as this are automatically sent once a day.  Their
 goal is to answer repeated questions, and to offer the content to
 the community for continuous evaluation/improvement.  The complete
 comp.lang.javascript FAQ is at http://jibbering.com/faq/index.html.
 The FAQ workers are a group of volunteers.

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc