document.links[0].onclick getting is null error in firefox 9 working fine below version 9
in js I have written following line of code to navigate back , home pages. this code works fine upto version 8 but not working in version 9 and above
<a href="#" onClick="goBack();" >Back to Previous</a> function goBack(){ //Disabled the action of the link after first click to avoid repeated click events-Sreejesh //once the action is compleated It will be activated by the function 'doCommonLoad' in commonfunctions.js objLinks = document.links; alert(objLinks.length); for(i=0;i<objLinks.length;i++){ alert(objLinks[i]); if(objLinks[i].onclick.toString().indexOf("goBack")>0){ objLinks[i].style.color="grey"; objLinks[i].removeAttribute('onClick'); } } if(taskList == true){ if (secondFrame == "tasklistframe") { hideFrame("inboxframe"); minimizeFrame("tasklistframe"); } else { hideFrame("tasklistframe"); minimizeFrame("inboxframe"); } } // if(twoFrames = false) // { // maximize('maincontentframe'); // } if(document.getElementById("statusbar").style.display == 'none') { document.getElementById("statusbar").style.display = 'block'; } document.getElementById("mainMin").style.visibility = "visible" parent.document.getElementById("hiddenframe").src="hidden.jsp?action=MENU_GO_BACK"; }
it gives error in js as -- objLinks[i].onclick is null when I click on the link
in js I have written following line of code to navigate back , home pages. this code works fine upto version 8 but not working in version 9 and above
<br />
<pre><nowiki><a href="#" onClick="goBack();" >Back to Previous</a>
function goBack(){
//Disabled the action of the link after first click to avoid repeated click events-Sreejesh
//once the action is compleated It will be activated by the function 'doCommonLoad' in commonfunctions.js
objLinks = document.links;
alert(objLinks.length);
for(i=0;i<objLinks.length;i++){
alert(objLinks[i]);
if(objLinks[i].onclick.toString().indexOf("goBack")>0){
objLinks[i].style.color="grey";
objLinks[i].removeAttribute('onClick');
}
}
if(taskList == true){
if (secondFrame == "tasklistframe") {
hideFrame("inboxframe");
minimizeFrame("tasklistframe");
} else {
hideFrame("tasklistframe");
minimizeFrame("inboxframe");
}
}
// if(twoFrames = false)
// {
// maximize('maincontentframe');
// }
if(document.getElementById("statusbar").style.display == 'none')
{
document.getElementById("statusbar").style.display = 'block';
}
document.getElementById("mainMin").style.visibility = "visible"
parent.document.getElementById("hiddenframe").src="hidden.jsp?action=MENU_GO_BACK";
}</nowiki></pre>
----------------------------------------------------
it gives error in js as -- objLinks[i].onclick is null when I click on the link
由cor-el于
所有回复 (1)
The following forum is a better place to ask about web development issues. http://forums.mozillazine.org/viewforum.php?f=25
Before doing that though, you should try this with Firefox 16.0.1.Update Firefox to the latest release