Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Rechercher dans l’assistance

Évitez les escroqueries à l’assistance. Nous ne vous demanderons jamais d’appeler ou d’envoyer un SMS à un numéro de téléphone ou de partager des informations personnelles. Veuillez signaler toute activité suspecte en utilisant l’option « Signaler un abus ».

En savoir plus

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

  • 1 réponse
  • 1 a ce problème
  • 7 vues
  • Dernière réponse par 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

Modifié le par cor-el

Toutes les réponses (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