Je reçois une erreur javascript sur une page avec cette erreur code.The est « parentNode est nulle ou non et objet »javascript erreur dans IE7
L'erreur est dans cette ligne: theParent.parentNode.removeChild(theParent);
Y at-il un autre code que je peux utiliser pour remplacer cela ou jquery que fonctionnera à la place?
var path = location.pathname;
if(path == "/SearchResults.asp"
|| path == "/ProductDetails.asp"
|| path.indexOf("-s/") != -1
|| path.indexOf("_s/") != -1
|| path.indexOf("_p/") != -1
|| path.indexOf("-p/") != -1) {
var links = document.getElementById("content_area")
.getElementsByTagName("a");
var homeLink;
for (var i = 0; i < links.length; i++) {
if (links[i].innerHTML.match("Home")) {
homeLink = links[i];
break;
}
}
var theParent = homeLink.parentNode;
theParent.parentNode.removeChild(theParent);
}
Avez-vous une page complète pour que nous puissions la tester nous-mêmes? –