Search EggHeadCafe's Job Board
EggHeadCafe Silverlight WPF ASP.NET VB.NET C# Excel SQL Server SharePoint
search
MicrosoftArticlesForumsFAQs
C# .NET
VB.NET
Visual Studio .NET
ADO.NET
Xml / Xslt
VB 6.0
.NET CF
GDI+
LINQ
Deployment
Security
FoxPro
Silverlight / WPF
Entity Framework
RIA Services

WebArticlesForumsFAQs
JavaScript
ASP
ASP.NET
WCF

DatabasesArticlesForumsFAQs
SQL Server
Access
Oracle
MySQL
Other Databases

OfficeArticlesForumsFAQs
Excel
Word
Powerpoint
Outlook
Publisher
Money

Non-MicrosoftArticlesForumsFAQs
NHibernate
Perl
PHP
Ruby
Java
Linux / Unix
Apple
Open Source

Operating SysArticlesForumsFAQs
Windows 7
Windows Server
Windows Vista
Windows XP
Windows Update
MAC
Linux / UNIX

Server PlatformsArticlesForumsFAQs
BizTalk
Site Server
Exhange Server
IIS

Graphic DesignArticlesForumsFAQs
Macromedia Flash
Adobe PhotoShop
Expression Blend
Expression Design
Expression Web

OtherArticlesForumsFAQs
Lounge
Subversion / CVS
Ask Dr. Dotnetsky
Active Directory
Networking
Uninstall Virus
Job Openings
Product Reviews
Search Engines
Resumes

 

  View Other JavaScript Posts   Ask New Question  Ask New Question With Power Editor

Firefox problem
mostafa hamdy posted at Thursday, August 17, 2006 8:03 AM

hi all
I have web page which contains table with ans  I  set for each row in   the table Name and Id attributes,and when I try to access soecific row in the table by name it works very  fine with IE but it makes problems with firefox and it display in the alert undefined: the code is listed below
-------------HTML code-----------------------
<table width="50%" bgcolor="#000000">
<tr id="tr1" name="firsttr"><td></td></tr>
<tr id="tr2" name="secondtr"><td></td></tr>
<tr id="tr3" name="thirdtr"><td></td></tr>
</table>
------------------------JS code---------------------------
function myFunction()
{
var trname = document.getElementByid('tr1').name ;
alert(trname);
}
plz if any body can help me in solving this problem plz send me
bets regards
Mostafa
Reply    Reply Using Power Editor
  Rank Winnings Points
November 0 $0.00 0
October 0 $0.00 0
Firefox and IE issues
J S replied on Thursday, August 17, 2006 8:10 AM

This will help u : http://west-wind.com/weblog/posts/1463.aspx
Reply    Reply Using Power Editor
  Rank Winnings Points
November 0 $0.00 0
October 0 $0.00 0

Example:
Peter Bromberg replied on Thursday, August 17, 2006 9:02 AM

function myFunction() 
{ 
var trname = document.getElementById('tr1').attributes['name'].value;
alert(trname); 
}
Reply    Reply Using Power Editor
Peter Bromberg is a C# MVP, MCP, and .NET expert who has worked in banking, financial and telephony for over 20 years. Pete focuses exclusively on the .NET Platform, and currently develops SOA and other .NET applications for a Fortune 500 clientele. Peter enjoys producing digital photo collage with Maya,playing jazz flute, the beach, and fine wines. You can view Peter's UnBlog and IttyUrl sites.
Please post questions at forums, not via email!
  Rank Winnings Points
November 0 $0.00 0
October 0 $0.00 0

Table Row Does not have a Name Attribute
Chad . replied on Thursday, August 17, 2006 9:25 AM

Hi,

As per W3c Specifications a Table Row does not have a name attribute.
Hence it is not advisable.
You can use the IDs for the same?
Is there any specific constraint that makes you use the name?
Let me know in case I can help you.

-
Chandu
Reply    Reply Using Power Editor
  Rank Winnings Points
November 0 $0.00 0
October 0 $0.00 0

RE:working code
Sushila Patel provided a rated reply on Thursday, August 17, 2006 12:23 PM

function myFunction() 
{ 
var trname = document.getElementById('tr1').getAttribute('name')  ; 
alert(trname); 
} 
Tested on Firefox and IE
Reply    Reply Using Power Editor
Microsoft Visual ASP/ASP.NET MVP
  Rank Winnings Points
November 0 $0.00 0
October 0 $0.00 0