Home  >  Article  >  Web Front-end  >  Summary of methods for obtaining several URL addresses with JS_javascript skills

Summary of methods for obtaining several URL addresses with JS_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:58:131002browse

The following are JS methods to obtain several URL addresses

Copy the code The code is 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 ];


The following is how to use JS to obtain the MAC address, IP address and host name:
Copy code The code is as follows:






                                   



MAC address:

IP Address:

Host name: