I used an Ajax request to populate a list dynamically. This action is triggered on the "pageshow " of the appropriate page.
- var populateList = function (url, selector) {
- ...
- var $elem = $(selector)
$elem.after('<li id="loading">loading</li>')
$.ajax({
type: "GET",
url:url,
data:{
lat: lat,
lng: lng,
timestamp: timestamp
},
success:function (data) {
console.log('loading...');
$(data).find('Placemark').each(function () {
var $placemark = $(this);
$('#loading').before(placemarkBuilder($placemark)); // This function output the appropriate output.
//console.log(placemarkBuilder($placemark));
});
$('#loading').remove();
},
datatype:'xml'
});
- $('#page_id').live('pageshow',function(event, ui){
populateList(articles_kml_url, '#wikipedia');
})
The problem is that the content of the page is add after the style is applied. What is the appropriate event that I should use to trigger this action.
Is it possible to "force" jquerymobile to re-apply the style "on demand" ?
Regards,
--yml