ie瀏覽器(ie11及以下)
阿新 • • 發佈:2018-12-30
(ie10,ie11)
開發環境下:
:在 Access-Control-Allow-Origin 標頭中未找到源 http://192.168.200.243:8077。
SCRIPT7002: XMLHttpRequest: 網路錯誤 0x80700013, 由於出現錯誤 80700013 而導致此項操作無法完成。
jQuery.support.cors = true; // 允許跨域請求 $.ajax({ type: 'get', url: api.user.getSystemUser, xhrFields: {withCredentials: true}, success: function (ret) { if (ret.code === 200) { // console.log(url,txt,menuId); url = url + '?token=' + ret.obj.token + '&tabId=' + menuId; open_addTab(url,txt,menuId); } else { window.location.href = constant.URL.PATH_LOGIN; } } });
jQuery.support.cors = true; // 允許跨域請求 $.ajax({ type: 'get', contentType: 'application/x-www-form-urlencoded;charset=UTF-8', cache : false, // 必須設定為false,否則在ie11及以下瀏覽器,介面判斷當前登入使用者的狀態仍是未登入 url: api.user.getSystemUser, xhrFields: {withCredentials: true}, success: function (ret) { if (ret.code === 200) { // console.log(url,txt,menuId); url = url + '?token=' + ret.obj.token + '&tabId=' + menuId; open_addTab(url,txt,menuId); } else { window.location.href = constant.URL.PATH_LOGIN; } } });