Menu
I’d like to change this code so that it only affects links which are images. I don’t know a way to specify that though ?
[code] var xpath = “//a[contains(@href, scriptBefore)]”;
var res = document.evaluate(xpath, document, null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
var i, link;
for (i = 0; link = res.snapshotItem(i); i++) {
link.href = link.href.replace(scriptBefore, scriptAfter);
}
Thanks