3

here is mycode

$('#edit-popout-warpper').load(url,function(){
  //the url contain the editnameform
            $('#editnameform').submit(function(e){
                e.preventDefault(); 
                var $form = $( this ),
                    term = $form.find( 'input[name="mymoname"]' ).val(),
                    urll = $form.attr( 'action' );
                $.post(urll,{mymoname:term});

            })
        })
        return false;

after i use jquery ajax load method the $.post is not working ,its not sending the post request any idea why?

i finally get it work only i used $.ajax like this

 $.ajax({
         type:'POST',
         url:urll,
         data:{mymoname:term}
       })

i don't know why. but at lest it worked.so anyone knows why the $,post not working please let me know thanx

4

1 回答 1

0

你错过了 post 回调函数。

$('#editnameform').submit(function (e) {
    e.preventDefault();
    var $form = $(this),
        term = $form.find('input[name="mymoname"]').val(),
        urll = $form.attr('action');
    $.post(urll, {
        mymoname: term
    }, function(data) {
       console.log(data);
    });
});
于 2012-07-06T06:31:46.533 回答