js | get url parameters

//Set or get the filename or path specified by the object.
alert(window.location.pathname);


//Set or get the entire URL as a string.
alert(window.location.href);


//Set or get the port number associated with the URL.
alert(window.location.port);


//Set or get the protocol part of the URL.
alert(window.location.protocol);


//Set or get the segment after the pound sign "#" in the href attribute.
alert(window.location.hash);


//Set or get the hostname and port number of the location or URL.
alert(window.location.host);


//Set or get the part that follows the question mark in the href attribute.
alert(window.location.search);

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325944937&siteId=291194637