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
                    }
                }
            });
  • 相关阅读:
    AngularJs $location 和 $window
    AngularJS——自定义服务详解(factory、service、provider)
    angularAMD+requireJs
    angular ui-router时要使用html5Mode=true
    CSS3的calc()使用
    React Ajax this.IsMounted() is not a function
    css有用的代码片段
    8908
    454
    234
  • 原文地址:https://www.cnblogs.com/hanlengyao/p/10150007.html
Copyright © 2011-2022 走看看