zoukankan      html  css  js  c++  java
  • Jquery前台调去JS的两种方式。

    1、首先我的JSON格式为:

    {
         totalCount:"1",
         success:true,error:"",
         data:
         [
            {
                DocName:"新建文本文档.txt",
                URL:"2b270311-d1f6-4e09-9f3b-35fe1f62.txt",
                JMBZ:"0",
                CJRID:"1",
                DocType:"txt"
            }
         ]
    }
    

    2、调用方式:

    $.ajax({
                    type: "POST",
                    url: targetUrl,
                    contentType: "application/json; charset=utf-8",
                    success: function (data, status) {
                        alert("返回数据URL:" + data.data.URL);

                    },
                    error: function (request, status, error) {
                        alert("系统错误,请联系管理员!" + error);
                    }
                });

    或者用

    $.getJSON("url",function(result){
         alert("返回数据URL:" + result.data.URL);

      });

  • 相关阅读:
    PKU1008
    PKU 1007
    PKU 3983
    PKU 1005
    PKU1004
    PKU 1003解题
    new.target
    debugger 关键字
    React 高阶组件
    CSS|规范
  • 原文地址:https://www.cnblogs.com/BeyondWJsel/p/2474698.html
Copyright © 2011-2022 走看看