Skip to content

Instantly share code, notes, and snippets.

@joshsmith
Created February 9, 2012 04:45
Show Gist options
  • Select an option

  • Save joshsmith/1777379 to your computer and use it in GitHub Desktop.

Select an option

Save joshsmith/1777379 to your computer and use it in GitHub Desktop.
if (typeof String.prototype.startsWith != 'function') {
String.prototype.startsWith = function (str){
return this.indexOf(str) == 0;
};
}
if (!share_url.startsWith("http://") && !share_url.startsWith("https://")) {
share_url = "http://" + share_url;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment