From abbfdde5cc569397f3b1f9ec3753f12de85eeb99 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Tue, 7 Jul 2015 14:55:35 -0400 Subject: [PATCH] fix for IE7 relative links --- src/rails.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rails.js b/src/rails.js index 2dc31e30..fe7f71ce 100644 --- a/src/rails.js +++ b/src/rails.js @@ -182,14 +182,17 @@ // Determines if the request is a cross domain request. isCrossDomain: function(url) { + var regexp = new RegExp('^\\s*(?:[a-z]+:)?//', 'i'); + if(!regexp.test(url)) { + return false; + } + var originAnchor = document.createElement('a'); originAnchor.href = location.href; var urlAnchor = document.createElement('a'); try { urlAnchor.href = url; - // This is a workaround to a IE bug. - urlAnchor.href = urlAnchor.href; // Make sure that the browser parses the URL and that the protocols and hosts match. return !urlAnchor.protocol || !urlAnchor.host ||