如何用JAVASCRIPT获取ASP中的变量的值
<%
i="abcd"
%>
<script language="javascript">
alert( "<%=i%>");
</script>
=========================
javascript取得文件路径的方法:
<script language="javascript">
<%
filePath=server.MapPath("book.xml")
filePath=replace(filePath,"\","\\")
%>
xmlPath="<%=filePath%>";
document.write(xmlPath);
</script>
*注意:javascript要获取asp中变量的值的时候,一定要用双引号把整个asp代码块(包括<%%>标签)包含起来,不然无效。