mi scrive
Gli script non possono chiudere finestre non aperte da script.
anche se in realta' la finestra viene aperta
praticamente lo script e' questo
codice:
if (location.href.search('pagina1') != -1) {
var body = document.getElementsByTagName("body").item(0).getElementsByTagName("td").item(4);
body.innerHTML += '
<input type=button value="Apritutti" onclick =' + apritutto() + '>';
}
if (location.href.search('pagina2') != -1) {
self.close();
}
function apritutto() {
var links = "";
for (i = 0 ; i < body.getElementsByTagName("a").length; i++)
if (body.getElementsByTagName("a")[i].getAttribute("target") != "_top")
links += 'window.open("' + body.getElementsByTagName("a")[i].getAttribute("HREF") + '");';
return links;
}
quello che dovrebbe far e' aprirmi tutti i link e (quando riusciro' a chiudere le finestre) chiudermi le finestre che non rispettano alcune condizioni