Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

url in js

window.location.protocol = “http:”
window.location.host = “css-tricks.com”
window.location.pathname = “/example/index.html”
window.location.search = “?s=flexbox”const
postID = (new URLSearchParams(window.location.search)).get('post');
 
PREVIOUS NEXT
Tagged: #url #js
ADD COMMENT
Topic
Name
7+8 =