Synchronous XMLHttpRequest in the main thread is an obsolete error

For some reason, I get the following error in an Angularjs application:

The synchronous XMLHttpRequest in the main thread is deprecated due to its harmful effects on the end user.

As I have no idea what causes it, I don’t know which code to share? The problem occurs when I switch to the state (ui-router), but there is no controller associated with this state.

Has anyone seen this before?

+2
source share
2 answers

This is caused by an attempt to make a synchronous AJAX call from a browser.

If an Ajax call is made through jQuery, it occurs when using:

async: false

as an argument for any of jQuery ajax calls.

native XMLHttpRequest, , :

xmlhttp.open(...)

false.


, ajax, - Javascript. , Ajax, , , () async.


, ajax Angular, , :

$HTTP AngularJS

$http angular.js

Angular , , , . XMLHttpRequest , XMLHttpRequest , , .open() .

+3

Synchronous XMLHttpRequest on the main thread is deprecated , .

vs js request:

  • AngularJS ( ) mytemplate.tmpl.html
  • camelCase: mytemplate.tmpl.html

, , / Mac (- OSX) - , Linux AWS.

.

, AJAX , - , , "".

+2

Source: https://habr.com/ru/post/1677743/


All Articles