jQuery移动标题修改不持久

jQuery移动标题修改不持久,jquery,jquery-mobile,Jquery,Jquery Mobile,我有一个简单的jQuery移动站点,它的标题中有一个按钮。代码是: <div data-theme="a" data-role="header" id="theheader"> <a href="/userAdd" data-icon="puls" data-theme="b" data-iconpos="notext">a</a> <h1>header</h1> <a href="/userShow" data-ic

我有一个简单的jQuery移动站点,它的标题中有一个按钮。代码是:

<div data-theme="a" data-role="header" id="theheader">
  <a href="/userAdd" data-icon="puls" data-theme="b" data-iconpos="notext">a</a>
  <h1>header</h1>
  <a href="/userShow" data-icon="star" data-theme="b" data-iconpos="notext" 
     id="notifybutton">x</a>
</div>
当我加载页面(F5)时,这可以正常工作

但是,只要我通过ajax加载程序加载了一个新页面,主题就不会保留。更糟糕的是,下次运行ajax时,按钮不再更新。从.trigger('pagecreate')到getItemById,我几乎都试过了


非常感谢你的帮助

您将需要向我们展示更多的代码。你的paga布局是什么?您在什么时候调用此函数?此函数在setInterval中每隔2500毫秒调用一次。每个PageDiv都有保存头。
setInterval(function () {
         $.get("/ajaxCheckNotifications", function(data){
            if (data != "0"){
                $("#notifybutton").buttonMarkup({theme: 'c'});
            }else{
                    $("#notifybutton").buttonMarkup({theme: 'b'});
            }
       });
}, 2500)