对话框中的Jquery移动复选框在移动设备上不起作用

时间:2013-11-02 09:33:31

标签: javascript php jquery jquery-mobile mobile

我有一个像这样的对话窗口:

<div data-role="dialog" class="windowsrestrictions" id="windowsrestrictions<?php echo ($i+1); ?>" data-close-btn="none">
<div data-role="header">
    <h1>Windows Kısıtlamaları</h1>
</div><!-- /header -->
<div data-role="content">   
    <p>
    <form>
        <fieldset data-role="controlgroup">
            <input type="checkbox" class="winrest" name="checkbox-v-2a" id="checkbox-v-2a" value="NoSetTaskbar">
            <label for="checkbox-v-2a">Taskbar'ın özelliklerini değiştirmeyi engelle</label>
            <input type="checkbox" class="winrest" name="checkbox-v-2b" id="checkbox-v-2b" value="NoFolderOptions">
            <label for="checkbox-v-2b">Klasör özelliklerine erişimi engelle</label>
            <input type="checkbox" class="winrest" name="checkbox-v-2c" id="checkbox-v-2c" value="DisableTaskMgr">
            <label for="checkbox-v-2c">Görev Yöneticisi'ne erişimi engelle</label>
            <input type="checkbox" class="winrest" name="checkbox-v-2d" id="checkbox-v-2d" value="NoClose">
            <label for="checkbox-v-2d">Bilgisayarı Kapat-Yeniden Başlat-Uyku Moduna Al Komutlarını engelle</label>
            <input type="checkbox" class="winrest" name="checkbox-v-2e" id="checkbox-v-2e" value="NoViewOnDrive">
            <label for="checkbox-v-2e">Sürücüleri engelle</label>
            <input type="checkbox" class="winrest" name="checkbox-v-2f" id="checkbox-v-2f" value="NoPropertiesMyComputer">
            <label for="checkbox-v-2f">Bilgisayarım özelliklerine girmeyi engelle</label>
            <input type="checkbox" class="winrest" name="checkbox-v-2g" id="checkbox-v-2g" value="NoControlPanel">
            <label for="checkbox-v-2g">Denetim Masası'na erişimi engelle</label>
            <input type="checkbox" class="winrest" name="checkbox-v-2h" id="checkbox-v-2h" value="NoRun">
            <label for="checkbox-v-2h">Çalıştır Komutunu engelle</label>
            <input type="checkbox" class="winrest" name="checkbox-v-2i" id="checkbox-v-2i" value="StartMenuLogOff">
            <label for="checkbox-v-2i">Oturumu Kapat komutunu engelle</label>
        </fieldset>
    </form>
    </p>        
</div><!-- /content -->
<div data-role="footer">
    <p>
    <a href="#" class="closedialogwindow" data-role="button" data-mini="true" data-inline="true">Vazgeç</a>
    </p>
</div><!-- /footer -->
</div><!-- /page -->

我用这行代码处理每个复选框的值:

$(document).on("click",".ui-checkbox",function(){
    $.mobile.showPageLoadingMsg();
    var rulename = $(this).find(".winrest").val();
    var id = $(this).parent().parent().parent().parent().parent().parent().attr("id");
    id = id.split("windowsrestrictions");
    id = id[1];
    var filterport = $("#filterport"+id).val();
    $.ajax({
        type:"GET",
        url:"../link.php",
        data:"port="+filterport+"&rule="+rulename,
        success:function(){
            $.mobile.hidePageLoadingMsg();
            }
        })
    });

我的问题是,当我使用Chrome在桌面打开页面时,它运行正常,但是当我打开带有移动设备页面的页面时,加载消息不会显示,并且ajax请求不起作用。任何人都有解决方案吗?

0 个答案:

没有答案