Developing a program for Angular 1.5.8
The same function is triggered when the page is loaded and pasted from the clipboard, and for some reason, when loading all goes normally, but when you paste from the clipboard in windows 10 in IE (other browsers works) at the start of the function XMLHttpRequest xhr.open ('put', 'http://localhost:62631/api/PlantConsignee/', true); I give error "invalid argument." And when i make angular wrap, i take error "Access denied" PlantConsignee.query ( Error: access Denied.
at Anonymous function (http://localhost:62631/prodaction/script/node_modules Oh.min.js?ver=0.6.6688.17819:125:278) at n (http://localhost:62631/prodaction/script/node_modules Oh.min.js?ver=0.6.6688.17819:122:53) at Anonymous function (http://localhost:62631/prodaction/script/node_modules Oh.min.js?ver=0.6.6688.17819:119:255) at Anonymous function (http://localhost:62631/prodaction/script/node_modules Oh.min.js?ver=0.6.6688.17819:154: 10) at m.prototype.$eval (http://localhost:62631/prodaction/script/node_modules.min.js?ver=0.6.6688.17819:168: 336) at m.prototype.$digest http://localhost:62631/prodaction/script/node_modules Oh.min.js?ver=0.6.6688.17819:165: 412) at m.prototype.$apply (http://localhost:62631/prodaction/script/node_modules.min.js?ver=0.6.6688.17819:169: 111) at Anonymous function (http://localhost:62631/prodaction/script/node_modules Oh.min.js?ver=0.6.6688.17819:299: 245) at w.event.dispatch (http://localhost:62631/prodaction/script/node_modules.min.js?ver=0.6.6688.17819:2: 41706) at y.handle (http://localhost:62631/prodaction/script/node_modules Oh.min.js?ver=0.6.6688.17819:2:39718)
function planttetst() {
console.log("Запрос заводов");
var xhr = new XMLHttpRequest();
xhr.open('put', 'http://localhost:62631/api/PlantConsignee/', true);
xhr.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
var inp = JSON.stringify({ "pageNumber": 1, "pageSize": 9999, "Count": 9999, "Items": [{ "Id": 1, "PlantCode": "**", "Code": "BP00016238" }] });
xhr.send(inp);
xhr.onreadystatechange = function () {
var response = xhr.responseText;
console.log("ответ заводов" + response.toString());
}
PlantConsignee.query({ "pageNumber": 1, "pageSize": 9999, "Count": 9999, "Items": [{ "Id": 1, "PlantCode": "**", "Code": "BP00016238" }] }).$promise.then(function (response) {
console.log("Запрос заводов мал" + (new Date).toString());
alert("super");
}).catch(function (reason) {
notifyService.error("Ошибка при загрузке справочника завод planttetst1" + ((reason === undefined || reason === null || reason.data === undefined) ? "" : reason.data.message) + ". Повторите попытку через 5 минут");
});
}
And the main thing, this error occurs only in IE, in chrome everything is available:/