How to use jQuery .ajax to my form's action

前端 未结 5 2310
你的背包
你的背包 2021-02-08 12:54

I changed my coding style for php and jQuery, but my Registration

$(\"#reg_form_company\").bind(\"submit\", function() {
    $.fancybox.showActivity();
    $.aj         


        
5条回答
  •  南旧
    南旧 (楼主)
    2021-02-08 13:20

        //This is still showing the cgi output of my script in the browser
     $('#myForm').submit(function()){
                     $('#myForm').preventDefault();
            $.ajax({
                type     : "POST",
                cache    : false,
                url      : $('#myForm').attr('action'),
                data     : $('#myForm').serialize(),
                success  : function(data) {
                    $(".printArea").empty().append(data).css('visibility','visible');
                };
    
        

提交回复
热议问题