How do insert the external code of register.html page in a div
when when it finishes successfully my call ajax
?
function onSuccess(data, status)
{
$.mobile.pageContainer = $("#content").pagecontainer();
$.mobile.pageContainer.pagecontainer("load", "register.html");
}
function onError(data, status)
{
// handle an error
}
I use pageContainer
but not load the html in #content div
If using JQuery, you can load in external pages/markup using the load method. This will allow you to then output it into a div.
$( "#result" ).load( "ajax/test.html" );
For more info, see
You'll need to use enhanceWithin() otherwise JQuery mobile enhancement won't be performed on the new content:
$.get('pagename.html', function (response) {
$('#result').html(response).enhanceWithin();
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.