In new browsers now there will be no more synchronous requests?

20

I saw today in my Google Chrome , updated to version 40.0.2214.91 , a message that said

  

Synchronous XMLHttpRequest on the main thread is deprecated because of   its detrimental effects to the end user's experience

translating:

  

The Synchronous XMLHttpRequest in the main thread is discouraged by   cause of its deleterious effects on the end user experience

This means that for new browsers, requests via AJAX will no longer have the synchronous request.

Should I start changing the way to program right now, thinking in the future that this directive will be removed?

    
asked by anonymous 23.01.2015 / 12:07

1 answer

15

Yeah, that's the idea. See the specification :

  

Synchronous XMLHttpRequest outside of workers is in the process of being removed from the web platform as it has detrimental effects to the end user's experience. (This is a long process that takes many years.) Developers must not pass false for the async argument when the global JavaScript environment is a document environment. User agents are strongly encouraged to warn of such usage in developer tools and may experiment with throwing an InvalidAccessError exception when it occurs.

What the browser is doing is following this recommendation above to warn you that this is a feature that should not be used. Or use the asynchronous request or do this in a thread worker .

Note that this will take so long that little done today will be alive by then. Terrible things, much worse than this, that were allowed 20 years ago still work today's browsers.

Unfortunately there are no more alerts. The vast majority of developers use things they should not do to the hills and do not even know it. Not only in JS in browsers, this holds true for many different languages and functionalities.

If something is considered obsolete, it should no longer be used in new things and whenever it has the opportunity to change something existing, it should be done.

Of course, if you do not you will not have problems for a long time, but there goes from the posture of each professional and resources (time mainly, to modify the existing one, although it is something fast in this case) that each one has.

But if you think about doing the synchronous request, it does not make much sense. If it's to do this, call the page. Many people find that AJAX is a programming language. It's just a very specific technique using XMLHTTPRequest and A means asynchronous (Asynchronous Javascript And XML). But no one else uses XML anymore:)

    
23.01.2015 / 12:30