Last active
August 29, 2015 14:04
-
-
Save tracend/a522e5a169aad662fa80 to your computer and use it in GitHub Desktop.
_.isURL() #underscore #mixin #cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.mixin({ | |
// - Checks if a string is a full URL | |
// Source: https://gist.github.com/tracend/a522e5a169aad662fa80 | |
isURL: function ( url ) { | |
// prerequisite | |
if( typeof url != "string" ) return false; | |
// | |
return ( url.substr(0, 4) == "http" || url.substr(0, 2) == "//" ); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment