•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 427,685 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,237 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 3913 | Replies: 1
![]() |
•
•
Join Date: Jan 2007
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
can anyone pls help me why FIREFOX displays 'reference to undefined property' message for this html page? It works fine in IE.
[code]
<html>
<head>
<title>Expandible row test in firefox</title>
<STYLE type="text/css">
.collapsed
{
DISPLAY: none;
}
</STYLE>
<script language="javascript" type="text/javascript">
//***collapsible rows
function outliner(evt) {
evt = (evt) ? evt : (window.event) ? window.event : "";
var oMe;
if (evt.srcElement) {
oMe = evt.srcElement;
} else if (evt.target) {
oMe = evt.target;
}
if (evt.srcElement) {
//for IE
var child = document.all[oMe.getAttribute("child",false)];
}
else {
//for Firefox
var child = document.getElementById[oMe.getAttribute("child",false)];
}
//get child element
//if child element exists, expand or collapse it.
if (null != child)
child.className = child.className == "collapsed" ? "expanded" : "collapsed";
}
function changepic(evt) {
evt = (evt) ? evt : (window.event) ? window.event : "";
var uMe;
if (evt.srcElement) {
uMe = evt.srcElement;
} else if (evt.target) {
uMe = evt.target;
}
var check = uMe.src.toLowerCase();
if (check.lastIndexOf("expand.gif") != -1)
{
uMe.src = "collapse.gif";
}
else
{
uMe.src = "expand.gif";
}
}
</script>
</head>
<body onclick="outliner(event)">
<table cellpadding="2" cellspacing="0" width="98%" class="infotable" bgcolor="#f4f4f4">
<caption class="issuetitle">NARMC Sleep Disorders Clinic Intake Form</caption>
<thead >
<tr>
<th class="header" width="1%" />
<td class="header"> Last Name:</td>
<td class="header"> First Name:</td>
<td class="header"> Gender:</td>
</tr>
</thead>
<tr>
<td class="content"><A HREF="javascript:" onClick="document.getElementById['srcidDBData115847296']"><IMG border="0" alt="expand/collapse" class="expandable" height="11" onclick="changepic(event)" src="expand.gif" width="9" child="srcidDBData115847296" ></A></td>
<td class="content">Caloris</td>
<td class="content">Morris</td>
<td class="content">M</td>
</tr>
<tr class="collapsed" bgcolor="#ffffff" id="srcidDBData115847296">
<td colspan="4"> Test
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
</code]
[code]
<html>
<head>
<title>Expandible row test in firefox</title>
<STYLE type="text/css">
.collapsed
{
DISPLAY: none;
}
</STYLE>
<script language="javascript" type="text/javascript">
//***collapsible rows
function outliner(evt) {
evt = (evt) ? evt : (window.event) ? window.event : "";
var oMe;
if (evt.srcElement) {
oMe = evt.srcElement;
} else if (evt.target) {
oMe = evt.target;
}
if (evt.srcElement) {
//for IE
var child = document.all[oMe.getAttribute("child",false)];
}
else {
//for Firefox
var child = document.getElementById[oMe.getAttribute("child",false)];
}
//get child element
//if child element exists, expand or collapse it.
if (null != child)
child.className = child.className == "collapsed" ? "expanded" : "collapsed";
}
function changepic(evt) {
evt = (evt) ? evt : (window.event) ? window.event : "";
var uMe;
if (evt.srcElement) {
uMe = evt.srcElement;
} else if (evt.target) {
uMe = evt.target;
}
var check = uMe.src.toLowerCase();
if (check.lastIndexOf("expand.gif") != -1)
{
uMe.src = "collapse.gif";
}
else
{
uMe.src = "expand.gif";
}
}
</script>
</head>
<body onclick="outliner(event)">
<table cellpadding="2" cellspacing="0" width="98%" class="infotable" bgcolor="#f4f4f4">
<caption class="issuetitle">NARMC Sleep Disorders Clinic Intake Form</caption>
<thead >
<tr>
<th class="header" width="1%" />
<td class="header"> Last Name:</td>
<td class="header"> First Name:</td>
<td class="header"> Gender:</td>
</tr>
</thead>
<tr>
<td class="content"><A HREF="javascript:" onClick="document.getElementById['srcidDBData115847296']"><IMG border="0" alt="expand/collapse" class="expandable" height="11" onclick="changepic(event)" src="expand.gif" width="9" child="srcidDBData115847296" ></A></td>
<td class="content">Caloris</td>
<td class="content">Morris</td>
<td class="content">M</td>
</tr>
<tr class="collapsed" bgcolor="#ffffff" id="srcidDBData115847296">
<td colspan="4"> Test
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
</code]
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
ajax asp beta bon browser browsers browsing c++ developer development echo email encryption europe firefox gecko home html internet internet explorer internet explorer 7 javascript leak linux memory microsoft mozilla msdn networking news office open source open-source patch phishing pointer reference scams security site social software sql super testing users vista web webmail
- C# IE Toolbar talking to C++ BHO (C#)
- word wrapping? (DaniWeb Community Feedback)
- Dev C++ linker errors, undefined reference (C++)
- Properties with no matching variable name (C#)
- Dev-C++, GLUI linker error, undefined reference (C++)
- undefined reference errors when using C++ Sockets Library (C++)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: new window? target="_blank" ?
- Next Thread: javascript works in IE but not working in firefox



Linear Mode