Skip to content

Commit aa8b0b7

Browse files
eddiemongejohnbender
authored andcommitted
Ajax should be disabled instead
1 parent 3f522a2 commit aa8b0b7

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

docs/_assets/js/jqm-docs.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,16 @@ $(function(){
5555
});
5656

5757

58-
$(function() {
59-
if ( location.protocol.substr(0,5) === 'file:' ) {
60-
$('a, input[type="submit"], form').attr('data-ajax', false)
61-
.filter('a')
62-
.filter('[href="../"]').attr('href', '../index.html').end()
63-
.filter('[href="../../"]').attr('href', '../../index.html').end()
64-
.filter('[href="../../../"]').attr('href', '../../../index.html').end();
65-
}
66-
});
58+
// Turn off AJAX for local file browsing
59+
if ( location.protocol.substr(0,5) === 'file:' ) {
60+
$( function() {
61+
$( "a" )
62+
.filter( "[href='../']" ).attr( "href", "../index.html" ).end()
63+
.filter( "[href='../../']" ).attr( "href", "../../index.html" ).end()
64+
.filter( "[href='../../../']" ).attr( "href", "../../../index.html" );
65+
});
66+
$( document ).bind( "mobileinit", function() {
67+
$.mobile.ajaxEnabled = false;
68+
});
69+
}
70+

0 commit comments

Comments
 (0)