<script type = "text/javascript">
thisurl = document.url;
Thishref = document.location.href;
thisloc = self.location.href;
thisdloc = document.location;
strwrite = "thisurl: [" + thisurl + "] <br />"
strwrite + = "Thishref: [" + Thishref + "] <br />"
strwrite + = "thisloc: [" + thisloc + "] <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 ()