RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
JQuery之$.ajaxPOST数据
    function postSimpleData() {
        $.ajax({
            type: "POST",
            url: "/Service/SimpleData",
            contentType: "application/json", //必须有
            dataType: "json", //表示返回值类型,不必须
            data: JSON.stringify({ 'foo': 'foovalue', 'bar': 'barvalue' }),  //相当于 //data: "{'str1':'foovalue', 'str2':'barvalue'}",            success: function (jsonResult) {
                alert(jsonResult);
            }
        });
    }

表单序列化:
    $.ajax({
        url:options.url,
        type:"POST",
        data:$("#Form1").serialize(),
        success: function(data) {
            if(options.success!=undefined)
            {
                options.success.call(this,data);
            }
        },
        error:function(){
            if(options.error!=undefined)
            {
                options.error.call(this,data);
            }
        }
    });   

网站名称:JQuery之$.ajaxPOST数据
网页链接:http://tyjierui.cn/article/ispicj.html