asp取地址栏地址

来源:百度知道 编辑:UC知道 时间:2024/05/14 02:50:13
我在index.html中用<script src="test.asp"></script>
test.asp内容如下:
<%
FileName=Request.ServerVariables("SCRIPT_NAME")
response.write "document.write('"&FileName&"')"
%>
然后打开index.html发现始终显示“test.asp”,我要的是“index.html”
怎么办呢?

<%
for each name in request.servervariables
response.write("<p><b>"&name&"</b>:")
response.write request.servervariables(name)
next
%>
看看有哪个是需要的,没有?……自己去改request.servervariables……,知道吗?

<script>
var strUrl=window.location.href;
var arrUrl=strUrl.split("/");
var strPage=arrUrl[arrUrl.length-1];
alert(strPage);
</script>

<%
FileName=request.servervariables("HTTP_REFERER")
response.write "document.write('"&FileName&"')"
%>

你这个语句有问题吗?