我正在尝试进行小书签测试。下面的代码适用于 FireFox,但不适用于 Safari 4.0.3。有人知道如何让它在 Safari 上运行吗?
javascript:var s = document.createElement("script");
s.text = "document.write('hello');";
s.type = "text/javascript";
document.body.appendChild(s);
我正在尝试进行小书签测试。下面的代码适用于 FireFox,但不适用于 Safari 4.0.3。有人知道如何让它在 Safari 上运行吗?
javascript:var s = document.createElement("script");
s.text = "document.write('hello');";
s.type = "text/javascript";
document.body.appendChild(s);
您需要在 document.write(...) 之后添加 document.close();
javascript:(function(){
s=document.createElement("script");
s.type="text/javascript";s.text="document.write('Hello88');document.close();"
document.body.appendChild(s);
})();
尝试:s.innerHTML = "document.write('hello');";