Pages
Home
About Me
Wordpress Codigs
Other codes
Monday, December 10, 2012
no domain in a string url
This is how to display a string url without its domain name.
var thisUrl="http://domain.com/directory/subdirectory/file.name"
var noDomainUrl = thisUrl.replace(/https?:\/\/[^\/]+/i, "");
alert(noDomainUrl);
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment