Created
November 4, 2014 19:10
-
-
Save dubravkoL/db5058678d0b228e70ad to your computer and use it in GitHub Desktop.
parseUrl.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a, | |
url = 'http://m.cg/'; | |
a = document.createElement('a'); | |
a.href = url; | |
console.log(a.protocol); // "http:" | |
console.log(a.hostname); // "m.cg" | |
console.log(a.pathname); // "/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment