X
Tap here to go to the mobile version of the site.
Your Firefox is out of date and may contain a security risk! Upgrade Firefox

Support Forum

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

Posted

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

Modified by cor-el

Additional System Details

This happened

Every time Firefox opened

This started when...

i upgrade to version 9 from version 8

Installed Plug-ins

  • Google Update
  • Picasa plugin
  • NPRuntime Script Plug-in Library for Java(TM) Deploy
  • Next Generation Java Plug-in 1.6.0_21 for Mozilla browsers
  • Adobe PDF Plug-In For Firefox and Netscape
  • DRM Store Netscape Plugin
  • Npdsplay dll
  • DRM Netscape Network Object
  • Office Plugin for Netscape Navigator

Application

  • User Agent: Mozilla/5.0 (Windows NT 5.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1

More Information

upgrade version to 9 and check browser error console i have seen --
objLinks[i].onclick is null following error

Tyler Downer
  • Administrator
  • Moderator
1165 solutions 6641 answers

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 version