Ashx中使用jQuery.Ajax方法的一些记录

1、Ashx中不能执行Context.Response.End();

2、Ashx中执行页面跳转可以采用回传RedirectUrl,在调用页面中实现跳转;

3、jQuery.Ajax - dataType:"json",设置json数据格式后,Ashx中可以不需要设置Response.ContentType="text/json";

4、jQuery.Ajax,设置dataType:"json"后,如果Ashx传回json数据格式有问题,会直接进入jQuery.Ajax.error();

5、Ashx中若有设置Session值,则该次Response将SetCookie;

--------------------------------------------------------------------------------

JSONP:

所有支持Javascript的浏览器都支持《同源策略》,(域名,协议,端口 都需要一致);

跨域的Ashx可以执行SetCookie;

原文地址:https://www.cnblogs.com/null2/p/3655520.html