如何使用jquery mobile在手机间隙中打开模态

时间:2016-11-29 11:54:33

标签: jquery cordova jquery-mobile mobile phonegap-build

如何在ajax调用后打开模态(弹出窗口)?

我的代码是

  $.ajax({
    url: 'http://192.168.1.24//ionic/search.php',
    type: "post",
    data: postdata,
    success: function (data) {

        $('#ScanModal').bind('click', function () {
            alert($(this).text());
        });
        $("#ScanModal").trigger("click");

    }
});

和html模态代码是如此需要在ajax调用后打开模态请帮帮我

 <a href="#myPopupDialog" data-rel="popup" id="ScanModal" style="display:none">click</a>
<div data-role="popup" id="myPopupDialog" class="ui-dialog-contain ui-overlay-shadow ui-corner-all" >
    <div data-role="header">
        <h1>Header Text</h1>
    </div>

    <div data-role="main" class="ui-content">
        <h2>Welcome to my Popup Dialog!</h2>
        <p>jQuery Mobile is FUN!</p>
        <a href="#" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b ui-icon-back ui-btn-icon-left" data-rel="back">Go Back</a>
    </div>

    <div data-role="footer">
        <h1>Footer Text</h1>
    </div>
</div>

0 个答案:

没有答案