Created
March 22, 2012 09:04
-
-
Save juanghurtado/2157246 to your computer and use it in GitHub Desktop.
$.mobile.changePage() fail on PhoneGap/Cordova 1.5.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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(); | |
}); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It was my fault. "new_page.html" had an error. Blame on me!