Permalink
Browse files

Navigation: Avoid redirect error by redirecting with plain JS

  • Loading branch information...
gabrielschulhof authored and arschmitz committed Mar 26, 2015
1 parent c6f4be8 commit ceb628b7312446dca132dfddedc8c4d3c401c784
@@ -1,15 +1,34 @@
<!doctype html>
<html>
<head>
<script src="../../../../external/jquery/jquery.js"></script>
<script src="../../../../js/"></script>
<script>
(function($) {
var l = $.mobile.path.parseLocation();
(function() {
// Regex taken from navigation/path
var parsedLocation = location.href.match( /^\s*(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/ );
// Redirect to sequence/index.html in the same directory as this file
location.href = l.protocol + "//" + l.host + l.directory + "index.html" + l.search + "#&ui-state=dialog";
})( jQuery );
location.href =
// protocol
( parsedLocation[ 4 ] || "" ) +
// double slash
( parsedLocation[ 5 ] || "" ) +
// host
( parsedLocation[ 10 ] || "" ) +
// directory
( parsedLocation[ 14 ] || "" ) +
"index.html" +
// search
( parsedLocation[ 16 ] || "" ) +
"#&ui-state=dialog";
})();
</script>
</head>
</html>
@@ -1,15 +1,39 @@
<!doctype html>
<html>
<head>
<script src="../../../../external/jquery/jquery.js"></script>
<script src="../../../../js/"></script>
<script>
(function($) {
var l = $.mobile.path.parseLocation();
(function() {
// Regex taken from navigation/path
var parsedLocation = location.href.match( /^\s*(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/ );
// Redirect to sequence-tests.html in the same directory as this file
location.href = l.protocol + "//" + l.host + l.directory + "sequence-redirect.html" + l.search + "#" + l.directory + "index.html" + "&ui-state=dialog";
})( jQuery );
location.href =
// protocol
( parsedLocation[ 4 ] || "" ) +
// double slash
( parsedLocation[ 5 ] || "" ) +
// host
( parsedLocation[ 10 ] || "" ) +
// directory
( parsedLocation[ 14 ] || "" ) +
"sequence-redirect.html" +
// search
( parsedLocation[ 16 ] || "" ) +
"#" +
// directory
( parsedLocation[ 14 ] || "" ) +
"index.html" + "&ui-state=dialog";
})();
</script>
</head>
</html>

0 comments on commit ceb628b

Please sign in to comment.