本文介绍了使用ajax和jquery提交数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我希望我不会来到错误的站点,但是我需要一些关于使用ajax和jquery发布数据的知识,我不知道自己要去哪里错了,因此我对jquery和ajax还是陌生的不胜感激

我有这个代码

Hi
I hope I did not come to the wrong site but I need some light in terms of posting data using ajax and jquery I don''t know where I''m going wrong hence I''m new to jquery and ajax any assistance will be appreciated

I have this code

var query = "companyname=" + companyname + "&Address1=" +address1 ;
                    query+= "&Address2=" + address2 + "&Area=" + area+ "&city="+city +"&code="+code;
                    query+= "&Province="+Province +"&fullname="+fullname+"&surname="+surname+"&email="+email +"&pass="+pass+"&number="+contacts+"&choice="+usertype;

                  alert(query);
                    $.ajax({
                        type :"POST",
                        url :"inc/functions.php?action=newagent",
                        data : query,
                        success: function(data){
                            if (data =='Success'){
                                //setTimeout('proceed()',5000);
                                alert("Success using Jquery");
                            }
                        }});

推荐答案



这篇关于使用ajax和jquery提交数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 22:21
查看更多