Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

remove hostname from url javascript

var URL = "http://localhost:7001/www.facebook.com";
var newURL = URL.replace (/^[a-z]{4,5}:/{2}[a-z]{1,}:[0-9]{1,4}.(.*)/, '$1'); // http or https
alert (newURL);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #hostname #url #javascript
ADD COMMENT
Topic
Name
2+5 =