jQuery Mobile 不刷新对象



我有一个包含三个部分的页面:
A、B、C部分

在A部分,有一组按钮发出Ajax请求,更新C部分。直到这里,一切都很好。

问题是,我在C部分的按钮(data-role="button"的一些链接)没有显示为按钮,而是显示为传统链接。

如何将链接外观更改为jQuery按钮?

<div id="setcionA">
    *** Here i call an mvc actionresult that return a partial view that update sectionC 
    <div class="nn" id="I_421" style="left: 0.06em; top: 0.06em; width: 5.18em; height: 5.5em;" onclick="loadXMLDoc('http://localhost:9063/Documentos/Docs/DocsAddItem?NumIdConcepto=421&NumCantidad=1','sectionC','0','POST');">
</div>
<div id="setcionB">
</div>
<div id="setcionC">
    *** This is the result of the ajax call .. but it appear as a link instead of a jquery mobile button
    <div data-role="controlgroup" data-type="horizontal">
        <a id="yes" href="index.html" data-role="button">Yes</a>
        <a href="index.html" data-role="button">No</a>
        <a href="index.html" data-role="button">Maybe</a>
    </div>
</div>

您的代码对我来说很好(除了在div中拼错单词"section"之外)。代码中没有显示的其他内容一定有问题。

编辑:使用jQuery mobile,做你想完成的事情,你最好用新内容刷新整个页面,而不是用Ajax更改页面。

通过ajax检索列表后,必须初始化

$('#ListView').listview(); // It Initializes
$('#ListView').listview('refresh'); // Refresh the list.

最新更新