Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
513 views
in Technique[技术] by (71.8m points)

javascript - ExtJS 4.2 - Possible causes of a "Sychronous XMLHttpRequest" warning?

Good day, sorry for the seemingly broad question title.

I am building an ExtJS4 application using php and sql for the user data. Everything was going fine until one day, I notice this error in my java console:

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. 
For more help, check http://xhr.spec.whatwg.org/.

Initially, I wasn't that troubled since my application was loading fairly well while testing it in my local network. However, once I uploaded to an online server and tested it, the application loaded really slowly and sometimes it wouldn't load at all.

I don't recall calling an XMLHttpRequest anywhere in my application, so I'm dumbfounded on how or why I'm getting this warning all of a sudden.

The only way I connect to my database and back is via Stores.

Also, as a side question, is there a way to make ExtJS4 applications load faster? I've minimized the size of the images/icons I use and I think the issue lies with the stores but none of my stores are set on autoload.

Any help is very much appreciated. Thank you.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had this error a while a ago. It is caused by Ext.Loader which loads the Ext classes dynamically.

I could solve it by adding the required classes in the Ext.require([...]) statement in the main js file of my application (i.e. app.js).

The docs for Ext.Loader explain when and why asynchronous and synchronous loading happens.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...