日期:2010-11-25  浏览次数:21225 次

<script language="JavaScript">
function changejs(n){
var str;
str = '<script language="JavaScript" type="text/javascript" src="inc/listnews.asp?page_no=';
str = str + n;
str = str + '"></script>';
document.getElementById("titleLiNews").innerHTML = str;
}
</script>

在页面中自定义了changejs函数后页面提示错误:
Active Server Pages 错误 'ASP 0138'
嵌套的 Script 块
/txwl/about_1.asp,行9
Script 块不能放在另一个 Script 块内。


只须将script拆开写即可:
<script language="JavaScript">
function changejs(n){
var str;
str = '<scr' + 'ipt language="JavaScript" type="text/javascript" src="inc/listnews.asp?page_no=';
str = str + n;
str = str + '"></scr' + 'ipt>';
document.getElementById("titleLiNews").innerHTML = str;
}
</script>