<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;
thishost = top.location.hostname;
thishost = location.hostname;
strwrite = "thertloc: [" + thattloc + "] <br />"
strwrite + = "thisploc: [" + thisploc + "] <br />"
strwrite + = "thishost: [" + thishost + "] <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 ()