简体   繁体   中英

Jquery ajax function call not made

I am having problems calling the function 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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