〈script language=“javascript“ src=“xxx.js“〉〈/script〉
〈!-- #include file=“xxx.asp“ --〉
〈script language=“javascript“ src=“xxx.asp?borid=5&page_no=3“〉〈/script〉
〈script language=“javascript“ src=“xxx.asp?borid=5&page_no=3“〉〈/script〉能将xxx.asp?borid=5&page_no=3的结果显示于页面,它好于〈!-- #include file=“xxx.asp“ --〉的地方或许您已经看出来了,就在于可以传递参数,并显示出结果,下边举一个简单的例子:
index.htm:
〈html〉
〈body〉
〈script language=“javascript“ src=“dy.asp?num=1“〉〈/script〉
〈/body〉
〈/html〉
dy.asp:
〈%
Dim temp
Temp=request.querystring(“num“)
If Temp=1 then
Response.write “document.write(’www.mzwu.com’);“
Elseif Temp=2 then
Response.write “document.write(’www.163.com’);“
Else
Response.write “document.write(’www.sohu.com’);“
End if
%〉
要注意的是 ASP 文件的输出内容必须按照 javascript 语法来编写,如:Response.write “document.write(’www.mzwu.com’);“
你的ASP文件输出的内容将是:document.write(’www.mzwu.com’);
这样就符合javascript规范,否则结果会提示脚本错误或者一片空白!