服务端 VBScript 与 JScript 几个相同特性的写法与示(2)
cnt=replace(cnt,"<"&chr(37),"")
cnt=replace(cnt,chr(37)&">","")
fInclude=cnt
end function 'shawl.qiu code'
execute fInclude("include/system/language/"&sitefglang&"/main.asp")
%>
3.2 JScript 动态包含文件
linenum
<%
eval($dynInc('aj2.asp'));
Response.Write($test);
function $dynInc($fl){
/* ------------------------------------\
* 服务端 JScript 动态包含文件 By shawl.qiu
* sample call: eval($dynInc('aj2.asp'));
\*------------------------------------*/
var $fso=new ActiveXObject("scripting.fileSystemObject");
$str=$fso.OpenTextFile(Server.MapPath($fl)).ReadAll();
$str=$str.replace(/\<\%|\%\>/g,'');
$fso=null;
return $str;
}
%>
内容版权声明:除非注明,否则皆为本站原创文章。