标签:net xmlhttp provider 请求 ini 解决办法 取数据 isa comm
在使用AngularJS发出请求(GET)获取服务端数据,然后再绑定到页面中,你会发现在IE中总是显示原来的数据结果。这时候我们就会知道,IE做了缓存。
ngApp.config(function ($httpProvider) {
// Initialize get if not there
if (!$httpProvider.defaults.headers.get) {
$httpProvider.defaults.headers.get = {};
}
// Enables Request.IsAjaxRequest() in ASP.NET MVC
$httpProvider.defaults.headers.common["X-Requested-With"] = ‘XMLHttpRequest‘;
//禁用IE对ajax的缓存
$httpProvider.defaults.headers.get[‘Cache-Control‘] = ‘no-cache‘;
$httpProvider.defaults.headers.get[‘Pragma‘] = ‘no-cache‘;
});
标签:net xmlhttp provider 请求 ini 解决办法 取数据 isa comm
原文地址:http://www.cnblogs.com/i362790954/p/6804831.html