搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Removing synchronous ajax as planned deprecation is a bad idea

  • 2 回覆
  • 10 有這個問題
  • 1 次檢視
  • 最近回覆由 Ted456

more options

Well that wasn't a question, but I have some serious misgivings about your proposed idea to get rid of synchronous ajax. Your site says:

Note: Starting with Gecko 30.0 (Firefox 30.0 / Thunderbird 30.0 / SeaMonkey 2.27), synchronous requests on the main thread have been deprecated due to the negative effects to the user experience.

As a simple developer of web forms, I assume that I am using the "main thread" and will be affected. Some of my forms are built dynamically and data is sometimes fetched dynamically as well. If I open a form for a user I may need to pre-populate the form fields with some data. In that case, I'd have to get the data (via synchronous ajax) before showing the form. This is a simple case and I think a common one. Am I missing something or am I just screwed?

Well that wasn't a question, but I have some serious misgivings about your proposed idea to get rid of synchronous ajax. Your site says: Note: Starting with Gecko 30.0 (Firefox 30.0 / Thunderbird 30.0 / SeaMonkey 2.27), synchronous requests on the main thread have been deprecated due to the negative effects to the user experience. As a simple developer of web forms, I assume that I am using the "main thread" and will be affected. Some of my forms are built dynamically and data is sometimes fetched dynamically as well. If I open a form for a user I may need to pre-populate the form fields with some data. In that case, I'd have to get the data (via synchronous ajax) before showing the form. This is a simple case and I think a common one. Am I missing something or am I just screwed?

所有回覆 (2)

more options

See:

It hasn't been removed in Firefox 30, but is merely tagged as deprecated

Synchronous XMLHttpRequest has been deprecated
  • Bug 969671 – Warn about use of sync XHR in the main thread
The async argument of the XMLHttpRequest constructor is true by default, and false makes the request synchronous. Developers now get an warning in the Web Console if a synchronous request is used on the main thread, or the outside of workers, since it's now considered deprecated due to the negative effects to the user experience.
more options

You make it sound like it's no big deal, merely "deprecated". I'd be wise to use another solution if the feature is going to go away in the future, no? I followed your links to end up here eventually:

http://xhr.spec.whatwg.org/#the-open%28%29-method

Should I take my gripe up with them instead? I'm assuming you are taking your cues from them.