Redirect On Change Of Large Select Menu In Jquery Mobile
I'm having an issue with trying to redirect to another page when a user selects an option from a
Solution 1:
I figured it out so I'm answering my own question.
Here's the code that fixed it for me:
var url = 'redirect-to-this-page.html',
$dialog = $('div.ui-page.ui-dialog.ui-page-active');
if ($dialog.length > 0) {
$dialog.bind('pagebeforehide', function () {
location.href = url;
});
} else {
location.href = url;
}
Solution 2:
Might as well let jQuery Mobile finish its little magic show by replacing your location.href
redirect with jQuery Mobile's implementation:
$.mobile.changePage( 'jquery-mobile-test.html?param=' + this.value );
Solution 3:
This is a dirty fix, but you can surround window.location with the setTimeout function:
setTimeout(function() {
window.location.href = '/some-url.html';
}, 0);
Post a Comment for "Redirect On Change Of Large Select Menu In Jquery Mobile"