为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

document.links[0].onclick getting is null error in firefox 9 working fine below version 9

  • 1 个回答
  • 1 人有此问题
  • 7 次查看
  • 最后回复者为 user633449

more options

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)

more options

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