Funkcjonalność tej witryny będzie ograniczona w czasie konserwacji. Jeśli artykuł nie rozwiązuje twojego problemu i chcesz zadać pytanie, to nasza społeczność wsparcia jest dostępna na @FirefoxSupport na Twitterze i /r/firefox na Reddicie.

Przeszukaj pomoc

Unikaj oszustw związanych z pomocą.Nigdy nie będziemy prosić Cię o dzwonienie na numer telefonu, wysyłanie SMS-ów ani o udostępnianie danych osobowych. Zgłoś podejrzaną aktywność, korzystając z opcji „Zgłoś nadużycie”.

Więcej informacji

Removing synchronous ajax as planned deprecation is a bad idea

  • 2 odpowiedzi
  • 10 osób ma ten problem
  • 1 wyświetlenie
  • Ostatnia odpowiedź od 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?

Wszystkie odpowiedzi (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.