I am trying to specify the contentType in the changePage, but it is not working. This is what I tried:
$.mobile.changePage('/Detail', {
type: 'POST',
contentType: 'application/json',
cache: false,
data: JSON.stringify({
item: marker.item
})
});
Is this possible? I thought it would be overriding the regular jQuery ajax but it does not seem so.
If you want to override default options, you must pass your options as second argument to the changePage function. Currently, you closed the parenthesis after your first argument so your options will not be passed as parameter to the function. But doing that, it will still not work as you intended because
contentTypeoption is not used in$.mobile.changePage()method. Please check http://jquerymobile.com/test/docs/api/methods.html for valid options.