提交网页文本,其中含有javascript语句,如何获得解释后的结果(100分)

Q

qaz1znz

Unregistered / Unconfirmed
GUEST, unregistred user!
原文件(含javascript语句)如下:
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="关键字" />
<meta name="description" content="说明" />
<title>无标题文档 </title>
</head>
</head>
<body>

<ul>
<%
var pid=new Array();
itj=3
pid[1]=1;
pid[2]=2;
pid[3]=3;
if (itj!=0)
for (i=1;i <=itj;i++)
{
Response.Write(' <li>'+pid+' </li>');
}
%>
</ul>
</body>
</html>

怎么才能写一个函数送入这段文本后,得到如下的结果文本:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="关键字" />
<meta name="description" content="说明" />
<title>无标题文档 </title>
</head>
</head>

<body>
<ul>
<li>1 </li> <li>2 </li> <li>3 </li>
</ul>
</body>
</html>
 
让IE解释了以后 你去前台的代码就是了,
基本思路就是上面的思路,具体实现应该用TWEBBROWSER,打开后另存就可以了
 
使用TWEBBROWSER时需要容 器,而我的程序里没有,也不允许容器的存在,求助~~~
 
顶部