I'm new in jquerymobile
, so, how can i migrate from a simple $.ajax()
call to a $.mobile.changePage
?
my normal ajax its something like this (from a click
event):
$.ajax({
url: 'mobile/' + content,
type: 'GET',
success: function (data) {
$(".content").html(data);
},
error: function (XMLHTTPRequest) {
}
});
basicly, all the ajax call (some simple html) will be droped inside the $(".content");
so, how can i do this, using changePage
?
i try this, but he only fade the page and nothing happen, i think my target is missing, dont know.
$(".bottom-but-list li").on("click", function () {
var content = $(this).attr("class").split(" ")[0]; // get the content to url
$.mobile.changePage("mobile/" + content, {
transition: "flip",
reverse: true,
changeHash: false,
pageContainer: $("#page")
});
});
html:
<div id="main-content" class="content">
<!-- ajax should load here -->
</div>
what i'm missing ?