zoukankan      html  css  js  c++  java
  • ajax 两者有什么不同

    $.ajax({
                type:"POST",
                url:url,
                //dataType:"json",
               // contentType: "application/json",
                data:JSON.stringify(smalltarget),
                success:function (data) {
                    console.log(data);
                    if(data.result){
                        sid=[];
                        content=[];
                        smalltarget=[];
                    }else{
                        layer.msg("数据更新不成功!",{offset:"100px"});
                    }
                }
            });

    $.post(
            url,
            {data:JSON.stringify(smalltarget)},
            function(data){
                if(true){
                    sid=[];
                    content=[];
                    smalltarget=[];
                }else{
                    alert(result);
                    layer.msg("数据更新不成功!",{offset:"100px"});
                }
            });   

    1.JSON.stringify(smalltarget)是字符串类型,不再是json了。

    2.springmvc接受的是key value值,第一种是嘛,一定要把原理弄清。

  • 相关阅读:
    (水题)洛谷
    (水题)洛谷
    洛谷
    (水题)洛谷
    POJ
    poj 3061(二分 or 尺取法)
    poj 2456(二分)
    poj 1064(二分答案)
    POJ 2559(单调栈)
    STL
  • 原文地址:https://www.cnblogs.com/wlhebut/p/7889945.html
Copyright © 2011-2022 走看看