0
我想更改我的網站的所有鏈接。假設通過。實例給出的鏈接http://www.google.com/更改http://www.example.com/?redirect=http://www.google.com/如何使用javascript更改iframe中的所有鏈接
我使用這個功能,它的工作原理,但在iframe中的鏈接不改變
window.onload = function() {
var anchors = document.getElementsByTagName("a");
for (var i = 0; i < anchors.length; i++) {
anchors[i].href = "http://www.example.com/?redirect=" + anchors[i].href
}
}
我想改變IFRAME裏的鏈接了。