coderifous / jquery-localize

a jQuery plugin that makes it easy to internationalize your web site.
465 stars 142 forks source link

Synchronous XMLHttpRequest warning #81

Closed magglomag closed 7 years ago

magglomag commented 8 years ago

Hi,

I get the following warning when implementing the plugin with $( '[data-localize]' ).localize( 'content' );:

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

Can anybody help out how to avoid that?

kropsi commented 8 years ago

The same problem here

dimitriscsd commented 8 years ago

Same here and pretty serious problem now as this functionality will be deprecated during September 2016

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. jquery-1.9.1.js:8526 Invoking 'send()' on a sync XHR during microtask execution is deprecated and will be removed in M53, around September 2016. See https://www.chromestatus.com/features/5647113010544640 for more details.

bigt11 commented 8 years ago

+1 I wont be able to use this until it get tweaked. An ETA??

dimitriscsd commented 8 years ago

We are getting closer and closer to the deprecation date. Does the author plan on fixing this or do we need to go custom or find another library?

All you need to do to be honest is switch the async: false option in the ajax call with a callback.

I tried looking in the code myself to see if I can fix it but from what I understand it's written in coffeescript?

dimitriscsd commented 7 years ago

Chrome 54 is out today. Any update on this?

dimitriscsd commented 7 years ago

Thank you for this Jim. Will try the new code soon :)

On Thu, Oct 13, 2016 at 3:36 PM, Jim Garvin notifications@github.com wrote:

Closed #81 https://github.com/coderifous/jquery-localize/issues/81 via d55b25f https://github.com/coderifous/jquery-localize/commit/d55b25fd6655549502b83304fadb7b47c7124940 .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/coderifous/jquery-localize/issues/81#event-822583201, or mute the thread https://github.com/notifications/unsubscribe-auth/AGgK0R59rf4Idap9n-kGTITbMoShbZ3Rks5qzkH4gaJpZM4JPpxA .

coderifous commented 7 years ago

@dimitriscsd Sorry I couldn't get to it sooner!