用js输出并执行js代码的方法

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<SCRIPT src="http://code.jquery.com/jquery-1.8.3.min.js"></SCRIPT>
<script language="javascript">
function fPageWrite(s) {
    try {
        if (typeof s == "function") {
            s = s();
        }
        if (s) {
            if (s == "") {
                s = "文件载入中,请稍候...";
            }
            document.write(s);
            //return s;
        }
    } catch (e) { }
}

function insertad(value) {
	document.getElementById("abcd").innerHTML = value;
}
</script>
</head>

<body>
<div id="msg">999999999999999999999999999999999999999999999</div>
<div id="news_main">
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p id="abcd">

</p>
<script>
var content = '<script src=\'http://www.junmibang.com/plus/ad_js.php?aid=46\' language=\'javascript\'><\/script>';
insertad(fPageWrite(content));
</script>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>

</div>

</body>
</html>
发表评论?

0 条评论。

发表评论

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据