Skip to content

Instantly share code, notes, and snippets.

@pifantastic
Created February 17, 2012 05:40
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 pifantastic/1850981 to your computer and use it in GitHub Desktop.
Save pifantastic/1850981 to your computer and use it in GitHub Desktop.
diff --git a/app/main.js b/app/main.js
index 766b9ec..baf67b8 100644
--- a/app/main.js
+++ b/app/main.js
@@ -65,7 +68,7 @@ function(namespace, jQuery, Backbone, Example) {
var protocol = this.protocol + "//";
// Ensure the protocol is not part of URL, meaning its relative.
- if (href && href.slice(0, protocol.length) !== protocol) {
+ if (href && href.slice(0, protocol.length) !== protocol && href.indexOf("javascript:") !== 0) {
// Stop the default event to ensure the link will not cause a page
// refresh.
evt.preventDefault();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment