Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <input type = 'text' name = 'URL'>
- var url="test.com";
- if (url.substring(0,7) != "http://")
- url = "http://" + url;
- alert(url);
- var normalizeUrl = function (url) {
- if( !/^https?:///i.test(url) ) {
- url = 'http://' + url;
- }
- return url;
- }
Add Comment
Please, Sign In to add comment