我一般把配置信息全部写入到js中,这样html和asp都可以用一个配置文件了
test.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript" src="config.js"></script>
</head>
<body>
<script type="text/javascript">
document.write (arr[0])
document.write (fun())
</script>
</body>
</html>
test.asp
<!--#include virtual="config.js"-->
<% Response.Clear() %>
<%
Response.Write(arr[0])
Response.Write(fun())
%>
config.js
//<%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%><%
var arr = new Array()
arr[0]="a"
arr[1]="b"
arr[2]="c"
function fun() {
return arr[1]
}
//%>
Last modified by vkill on2008/11/04 10:16
test.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript" src="config.js"></script>
</head>
<body>
<script type="text/javascript">
document.write (arr[0])
document.write (fun())
</script>
</body>
</html>
test.asp
<!--#include virtual="config.js"-->
<% Response.Clear() %>
<%
Response.Write(arr[0])
Response.Write(fun())
%>
config.js
//<%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%><%
var arr = new Array()
arr[0]="a"
arr[1]="b"
arr[2]="c"
function fun() {
return arr[1]
}
//%>
Last modified by vkill on2008/11/04 10:16
网友评论(0):


