简体   繁体   English

jQuery Ajax函数调用未完成

[英]Jquery ajax function call not made

I am having problems calling the function callpage 我有调用函数的问题callpage

Here is the code were I am trying to call the function. 这是我尝试调用该函数的代码。 I got a label that when click I want to call callpage: 我得到一个标签,当单击该标签时,我想调用呼叫页:

$('.gulemenu label, .payload label').toggle(function(){
    $(this).find('input[type="checkbox"]').prop('checked',true);
    $.(this).callpage();
}, function(){
    $(this).find('input[type="checkbox"]').prop('checked',false);
    $.(this).callpage();
});

$('.gulemenu input, .payload label').bind('click',function(e){ e.stopPropagation(); });

My callpage function: 我的通话功能:

function callpage() {
    $('#formcontent').empty().html('<p style="margin-top:20px;text-align:center;font-family:verdana;font-size:14px;">Vent venligst, henter webhosts.</p><p style="margin-top:20px;margin-bottom:20px;text-align:center;"><img src="../images/ajax.gif" /></p>');
    var form = $('form#search');
    $.ajax({
        type: form.attr('method'),
        url: form.attr('action'),
        data: form.serialize(),
        success:function(msg){
        $('#formcontent').html(msg);
    }})
}

希望能奏效

$(this).find('input[type="checkbox"]').prop('checked',true).end().callpage();
 <script type="text/javascript">
    var slider = $("#mySliderSelector").slider({whatever:'you need'});

    $('.gulemenu label, .payload label').click(function(event){
e.stopPropagation();
       var checkbox = $(this).find(":checkbox"); //child checkbox inputs. you are sure there is only one correct?
       var checked = checkbox.prop("checked");
       checkbox.prop("checked", !checked);
       slider.trigger("slidestop"); //jQuery-ui documentation for slideStop event.
    });
    </script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM