• asp.net jquery ajax 跨域调用


    js:
            jQuery(document).ready(function(){
                    $.ajax({
                        type : 
    "GET",
                        url : 
    "http://service.test.com/t1.ashx?callback=?",
                        dataType : 
    "jsonp",
                       jsonp: 
    "callback",
                        success : 
    function(json){
                            $(
    '#feeds').html(json.msg);
                            
    return true;
                        }
                    });
                });

        <div id="feeds">   </div>

    t1.ashx
    1         public void ProcessRequest(HttpContext context)
    2         {
    3             context.Response.ContentType = "text/html";
    4             string callback = context.Request.Params["callback"];
    5             context.Response.Write(callback + "({\"msg\":\"jquery test message!\"})");
    6         }
  • 相关阅读:
    第二阶段冲刺01
    客户端-服务器模式
    可用性和可修改性战术分析
    质量属性
    《架构漫谈》阅读笔记
    《软件需求模式》06
    《软件需求模式》05
    《软件需求模式》04
    《软件需求模式》03
    《软件需求模式》02
  • 原文地址:https://www.cnblogs.com/myx/p/1554978.html
Copyright © 2020-2023  润新知