<type skrip = "Teks/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 + = "iniPLOC: [" + thisploc + "] <br />"
strwrite + = "thisthost: [" + thisthost + "] <br />"
strwrite + = "thineShost: [" + thisthost + "] <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 + = "ini UPage: [" + thisUpage + "] <br />"
document.write (strwrite);
var url = "<%= request.getRequesturi ()%>";
Peringatan (URL)
</script>
request.getRequesturi ();
request.getRequesturl ();
request.getQueryString ();
request.getServletPath ()
可以得到自己的网络地址 : request.getscheme ()+": //"+request.getServerame ()+":"+request.getServerport ()+request.getRequesturi ()