返回列表 发帖

[版本发布] 世界之窗插件 RunCode 执行html代码

一个非常非常简单的插件,起因来自我自己的需要,也因看到一些网页上有执行html代码的功能,非常羡慕.^_^.代码很少,是我网上找到。我帖一下。
<script language="javascript">
function runCode(code) //定义一个运行代码的函数,
{
var newwin=window.open('','',''); //打开一个窗口并赋给变量newwin。
newwin.opener = null // 防止代码对论谈页面修改
newwin.document.write(code); //向这个打开的窗口中写入代码code,这样就实现了运行代码功能。
newwin.document.close();
}
var t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection &&document.selection.createRange&&document.selection.createRange().text));
runCode(t)
</script>
需要的朋友自己下载。使用时选中要执行的代码,然后点一下就可以了
http://xn99.cn/upload/winslow/ZD_200895213638_e282.rar

<script language="javascript">
alert("谢谢呀,太感谢了")
</script>


选中上边的试一下,

TOP

返回列表