如何通过代理获取外部网站的iframe内容,以使每个框架具有相同的域名?
我想将此javascript代码添加到iframe内容:
window.highlight = function() {
var selection = window.getSelection().getRangeAt(0);
var selectedText = selection.extractContents();
var span = document.createElement("span");
span.style.backgroundColor = "yellow";
span.appendChild(selectedText);
span.onclick = function (ev) {
this.parentNode.insertBefore(document.createTextNode(this.innerHTML), this);
this.parentNode.removeChild(this);
}
selection.insertNode(span);
}