zoukankan      html  css  js  c++  java
  • jQuery ajax请求 一般请求和自定义请求

     
    //一般post请求
           $.ajax({
                    type:"POST",
                    url:url,
                    async:false,
                    data:Data,
                    dataType:'json',
                    success:function(data){
                         console.log(data);
                    }
                });
    //特定请求头的请求    application/json
     
        
                 url = "http://*************:8080/biz-services/sdk/qryGroups/offline"
                Data = {pageCategoryType:pageCategoryType,pageId:pageId,day:day},
                $.ajax({
                type:"POST",
                url:url,
                // async:false,
                contentType: 'application/json;charset=UTF-8',
                headers: {
                     'Accept': 'application/json',
                     'Content-Type': 'application/json'
                },
                dataType:'json',
                data: JSON.stringify(Data),//对请求参数进行json转化
                success:function(data){
                    console.log(data.datas);
                    if(data.result == 1){
                        return
                    }
                }
            });
  • 相关阅读:
    POJ 1095 Trees Made to Order 最详细的解题报告
    Producter and Consumer
    How to use the function of bind
    How to use the functions of apply and call
    Configurate vim tool
    #4713. 方程
    #4709. 树
    #4718. 管理
    #4710. 并
    #4707. 点分治
  • 原文地址:https://www.cnblogs.com/hanlengyao/p/10150007.html
Copyright © 2011-2022 走看看