zoukankan      html  css  js  c++  java
  • 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);
                }
            }
        });   
  • 相关阅读:
    MCU开发之I2C通信
    hibernate特殊的映射
    Hibernate使用
    css设置让a标签充满整个li
    margin
    border属性
    列表
    链接样式
    相机内参外参
    tmux
  • 原文地址:https://www.cnblogs.com/wsoft/p/4179813.html
Copyright © 2011-2022 走看看