Jquery ajax function call not made
I am having problems calling the function callpage
Here is the code were I am 开发者_Python百科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);
}})
}
<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>
Hope it works
$(this).find('input[type="checkbox"]').prop('checked',true).end().callpage();
精彩评论