<script type = "text/javascript">
thisurl = document.url;
thishref = document.location.href;
thissloc = self.location.href;
thisdloc = document.location;
strwrite = "thisurl:[" + thisurl + "] <br />"
strwrite + = "thishref:[" + thishref + "] <br />"
strwrite + = "thissloc:[" + thissloc + "] <br />"
strwrite + = "thisdloc:[" + thisdloc + "] <br />"
document.write(strwrite);
thistloc = top.location.href;
thisploc = parent.document.location;
thisthost = top.location.hostname;
thishost = location.hostname;
strwrite = "thistloc:[" + thistloc + "] <br />"
strwrite + = "thisploc:[" + thisploc + "] <br />"
strwrite + = "thisthost:[" + thisthost + "] <br />"
strwrite + = "thishost:[" + thishost + "] <br />"
document.write(strwrite);
tmphpage = thishref.split( "/");
thishpage = tmphpage [tmphpage.length-1];
tmpupage = thisurl.split( "/");
thisupage = tmpupage [tmpupage.length-1];
strwrite = "thishpage:[" + thishpage + "] <br />"
strwrite + = "thisupage:[" + thisupage + "] <br />"
document.write(strwrite);
var url = "<%= request.getRequesturi()%>";
アラート(URL)
</script>
request.getRequesturi();
request.getRequesturl();
request.getqueryString();
request.getServletPath()
可以得到自己的网络地址:request.getScheme()+"://"+request.getServername()+":"+request.getServerport()+request.getRequesturi()