search
Japanese Chinese Nederlands Espanol Italiano Deutsch Francais Twitter Rss Feeds
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

Web ProgrammingArticlesForumsFAQs
JavaScript
ASP
ASP.NET
Web Services

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

DatabasesArticlesForumsFAQs
SQL Server
Access
Oracle
MySQL
Other Databases

OfficeArticlesForumsFAQs
Excel
Word
Powerpoint
Outlook
Publisher
Money

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

Server PlatformsArticlesForumsFAQs
BizTalk
Site Server
Exhange Server
IIS
Transaction Server

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

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

 

View Other JavaScript Posts   Ask New Question 
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

 
Firefox and IE issues
J S replied at Thursday, August 17, 2006 8:10 AM
This will help u : http://west-wind.com/weblog/posts/1463.aspx
 
Example:
Peter Bromberg replied at Thursday, August 17, 2006 9:02 AM
function myFunction() 
{ 
var trname = document.getElementById('tr1').attributes['name'].value;
alert(trname); 
}
 
Table Row Does not have a Name Attribute
Chad . replied at 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
 
  RE:working code
Sushila Patel replied at Thursday, August 17, 2006 12:23 PM
function myFunction() 
{ 
var trname = document.getElementById('tr1').getAttribute('name')  ; 
alert(trname); 
} 
Tested on Firefox and IE