问题
I am loading content on jquery mobile collapsable dynamically and would like to show loading image while contents are being loaded once clicked on other list the previous one to be closed and want to destroy its cache as well so that if again clicked it shows new content as I am loading random content on collapsable.
Here is my code using for loading content dynamically in collapsable:
<script>
$('div.info').live('expand', function(){
var record = $(this).data("record");
console.log('expanded '+record);
$(".detail", this).load("get5.php?record="+record);
});
</script>
Live link:
UPDATE
$('div.info').live('expand', function(){
var record = $(this).data("record");
if (typeof(console.log) == 'function') {
console.log('expanded'+record);
}
$.mobile.loadingMessage = "please wait...";
$(".detail", this).load("quotesget5.php?record="+record, function(data){
$("."+info+" ul.check").html(data).listview('refresh');
$.mobile.showPageLoadingMsg();
});
}).live('collapse', function () {
$(this).find('.check').find('li').remove();
});
来源:https://stackoverflow.com/questions/24347464/destroy-cache-on-dynamically-loading-jquery-mobile-collapsable-content