This article is mainly for JS access to several URL address methods to summarize the introduction, the need for friends can come to the reference, I hope to help you.
The following is JS to obtain several URL address method code as follows: Thisurl = document. URL; Thishref = Document.location.href; Thissloc = Self.location.href; Thisdloc = document.location; Thistloc = Top.location.href; Thisploc = parent.document.location; Thisthost = Top.location.hostname; Thishost = Location.hostname; Tmphpage = Thishref.split ("/"); Thishpage = tmphpage[Tmphpage.length-1]; Tmpupage = Thisurl.split ("/"); Thisupage = tmpupage[Tmpupage.length-1]; below for the use of JS to obtain MAC address, IP address and host name method: Code as follows: <html> <head> <title></title> <meta http-equiv= "Content-type" content= "text/html; CHARSET=GBK "> </head> <body> <object classid=" CLSID : 76a64158-cb41-11d1-8b02-00600806d9b6 "id=" locator "style=" Display:none;visibility:hidden "></object> <object classid= "clsid:75718c9a-f029-11d1-a1ac-00c04fb6c223" id= "foo" style= "Display:none;visibility:hidden" ></object> &NB Sp <form name= "MyForm" > <br/>mac address: <input type= "text" name= "macAddress" > <br/>ip Address: <input type= "text" Name= "IPAddress" > <br/> host Name: <input type= "text" name= "HostName" > </form> </body> </html> <script language= "JavaScript" > var smacaddr= ""; var sipaddr= ""; var sdnsname= ""; var service = Locator. ConnectServer (); Service. Security_. impersonationlevel=3; Service. Instancesofasync (foo, ' Win32_NetworkAdapterConfiguration '); </script> <script for= "foo" event= "OnObjectReady (objobject,objasynccontext)" language= " JScript "> if (objobject.ipenabled!= null && objobject.ipenabled!=" undefine D "&& objobject.ipenabled = = True" {   if (objobject.ipenabled && objobject.ipaddress (0)!=null && objobject.ipaddress (0)!= " Undefined ") &NBSP ; &NBSP;SIPADDR = objobject.ipaddress (0); &NBSP;IF (objobject.macaddress! = null &&objobject.macaddress!= "undefined") &NBSP ; &NBSP;SMACADDR = objobject.macaddress; &NBSP;IF (objobject.dnshostname != null &&objobject.dnshostname!= "undefined") &NB Sp sdnsname = Objobject.dnshostname; } </SCript> <script for= "foo" event= "oncompleted (Hresult,perrorobject, Pasynccontext)" language= "JScript" > MYFORM.MACADDRESS.VALUE=SMACADDR; MYFORM.IPADDRESS.VALUE=SIPADDR; Myform.hostname.value=sdnsname; </script>