Javascript 动态加载jquery mobile可折叠内容时销毁缓存

Javascript 动态加载jquery mobile可折叠内容时销毁缓存,javascript,jquery,html,css,jquery-mobile,Javascript,Jquery,Html,Css,Jquery Mobile,我在jquery mobile collapsable上动态加载内容,并希望在加载内容时显示加载图像,一旦单击其他列表,上一个列表将被关闭,并希望销毁其缓存,以便再次单击时,在我在collapsable上加载随机内容时显示新内容 下面是我用于在collapsable中动态加载内容的代码: <script> $('div.info').live('expand', function(){ var record = $(this).data("record"); conso

我在jquery mobile collapsable上动态加载内容,并希望在加载内容时显示加载图像,一旦单击其他列表,上一个列表将被关闭,并希望销毁其缓存,以便再次单击时,在我在collapsable上加载随机内容时显示新内容

下面是我用于在collapsable中动态加载内容的代码:

 <script>

$('div.info').live('expand', function(){
    var record = $(this).data("record");
 console.log('expanded '+record);
    $(".detail", this).load("get5.php?record="+record);




    });
  </script>

您是否尝试过在AJAX请求之前调用该方法来显示加载微调器,然后在AJAX请求之后调用该方法来隐藏加载微调器(在请求的回调中)?@我尝试过这个$('div.info').live('expand',function(){var record=$(this.data(“record”);if(typeof(console.log)='function')){console.log('expanded'+record);}$.mobile.loadingMessage=“请稍候…”;$(.detail),this).load('quotesget5.php?record=“+record,function(data){$(“+info+”ul.check”).html(data).listview('refresh');$.mobile.showPageLoadingMsg();});}.live('collapse',函数(){$(this).find('.check').find('li').remove();});@Jasper我想在一次又一次折叠时刷新collapsable的内容clocked@Jasper你能帮忙吗,这是我用重要的代码更新了你的问题的实时链接…在你的问题中发布正确的代码很重要,否则有人会如何帮助你?我想你可能误解了回调的用法用于AJAX请求的函数。您需要做的是在创建AJAX请求之前调用
$.mobile.showPageLoadingMsg();
,然后调用
$.mobile.hidePageLoadingMsg())在回调函数中。这将创建以下流:1.显示加载微调器。2.创建AJAX请求。3.当AJAX请求返回时,隐藏加载微调器。
$('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();
});