Closed agourlay closed 11 years ago
Remove the ugly (and buggy) regular expressions and use an url parser to work with urls in content. Such as https://github.com/allmarkedup/jQuery-URL-Parser.
E.g : var url = $.url('http://allmarkedup.com/folder/dir/index.html?item=value'); url.attr('protocol'); // returns 'http' url.attr('path'); // returns '/folder/dir/index.html' url.attr('host'); // returns 'allmarkedup.com' etc...
Remove the ugly (and buggy) regular expressions and use an url parser to work with urls in content. Such as https://github.com/allmarkedup/jQuery-URL-Parser.
E.g : var url = $.url('http://allmarkedup.com/folder/dir/index.html?item=value'); url.attr('protocol'); // returns 'http' url.attr('path'); // returns '/folder/dir/index.html' url.attr('host'); // returns 'allmarkedup.com' etc...