Skip to content

Instantly share code, notes, and snippets.

@tracend
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tracend/a522e5a169aad662fa80 to your computer and use it in GitHub Desktop.
Save tracend/a522e5a169aad662fa80 to your computer and use it in GitHub Desktop.
_.isURL() #underscore #mixin #cc
_.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