We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

ძიება მხარდაჭერაში

ნუ გაებმებით თაღლითების მახეში მხარდაჭერის საიტზე. აქ არასდროს მოგთხოვენ სატელეფონო ნომერზე დარეკვას, შეტყობინების გამოგზავნას ან პირადი მონაცემების გაზიარებას. გთხოვთ, გვაცნობოთ რამე საეჭვოს შემჩნევისას „დარღვევაზე მოხსენების“ მეშვეობით.

ვრცლად

Removing synchronous ajax as planned deprecation is a bad idea

  • 2 პასუხი
  • 10 მომხმარებელი წააწყდა მსგავს სიძნელეს
  • 1 ნახვა
  • ბოლოს გამოეხმაურა Ted456

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)

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.

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.