Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > reliable way to get element by name

Reply
Thread Tools

reliable way to get element by name

 
 
Andrew Poulos
Guest
Posts: n/a
 
      08-05-2006
I'm working on updating some pages for a client that include Flash. The
pages have both OBJECT and EMBED tags. The ID for the OBJECT tag is
mirrored by the EMBED's tag NAME attribute.

quirksmode.org reckons that getElementsByName gives 'incorrect' results
for 4 of the 6 browsers that was tested. Is there a reliable way to
refer to the EMBED by its NAME?

Andrew Poulos
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      08-05-2006


Andrew Poulos wrote:

> I'm working on updating some pages for a client that include Flash. The
> pages have both OBJECT and EMBED tags. The ID for the OBJECT tag is
> mirrored by the EMBED's tag NAME attribute.
>
> quirksmode.org reckons that getElementsByName gives 'incorrect' results
> for 4 of the 6 browsers that was tested. Is there a reliable way to
> refer to the EMBED by its NAME?


DOM Level 0
document.embeds['embedName']
should do better that getElementsByTagName.


--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need a reliable way for faster lookup. Sudarshan Narasimhan C++ 6 10-08-2009 01:04 PM
how to Update/insert an xml element's text----> (<element>text</element>) HANM XML 2 01-29-2008 03:31 PM
how can i retrieve the name of form when one of the element name in this form is 'name' ashok.dhananjeyan@gmail.com Javascript 6 11-24-2006 02:54 AM
reliable way of finding Objects Class? walter@mwsewall.com Ruby 3 07-17-2003 02:18 PM
Re: Urgent! how to get object name, method name and attribute name based on the strings? ding feng C++ 2 06-25-2003 01:18 PM



Advertisments