Skip to content

Instantly share code, notes, and snippets.

@juanghurtado
Created March 22, 2012 09:04
Show Gist options
  • Save juanghurtado/2157246 to your computer and use it in GitHub Desktop.
Save juanghurtado/2157246 to your computer and use it in GitHub Desktop.
$.mobile.changePage() fail on PhoneGap/Cordova 1.5.0
(function() {
$('#new-town').bind('pagebeforeshow', function(event) {
$('a.my_link').bind('click', function(event) {
$.ajax({
contentType: 'application/x-www-form-urlencoded',
type: 'POST',
url: 'http://example.com/rest/sample',
data: sample_params,
success: function(data) {
console.log('Ajax request is nice!');
$.mobile.changePage("new_page.html", {
reloadPage: true
});
console.log('changePage does not fail because this line is executed');
}
);
event.preventDefault();
});
});
})();
@juanghurtado
Copy link
Author

It was my fault. "new_page.html" had an error. Blame on me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment