arvgta / ajaxify

Ajaxify - An Ajax Plugin
https://4nf.org/
275 stars 124 forks source link

Question: Deprecated Synchronout XMLHttpRequest #74

Closed thinsoldier closed 6 years ago

thinsoldier commented 9 years ago

I recently noticed this in my console on a site I used your history.js with:

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

I'm wondering if this has something to do with your history.js or something in pronto.js

And do you have any tips for someone looking to upgrade from history.min.js version 3.3.0 to the latest version of ajaxify.min.js 5.7.0?

arvgta commented 9 years ago

Hi Thinsoldier!

Yes, it's coming from ajaxify.js in general though I have not succeeded in pin-pointing the origin of the message.

Have tried specifying:

async: true

...explicitly in the central...

$.ajax() 

...call, just now.

Unfortunately, that doesn't change a thing.

So, I'm wondering, whether this issue could be it? Does anyone else have a clue?

When migrating from 3.3.0 to 5.7.0, one obviously has to pay attention to the interface changes.

Cheers and Regards

arvgta commented 9 years ago

Have raised this issue at forum.jquery.com

Summary / outcome of the thread:

url:"http://4nf.org/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1&_=1437239057175" is being requested with async:false

However, the warning is also generated on e.g. Barz Noble, therefore ruling out, that it is site specific to 4nf.org.


@thinsoldier : The thread has returned with a synthesis It's due to script src= tags being injected dynamically in the head.

Jake, the moderator at forum.jquery.com doesn't think there is much that can be done. Supposedly, this issue will disappear in future jQuery versions. (in the current version of JQ 3.0 Alpha - it persists)

thinsoldier commented 9 years ago

Thanks arvgta.

My real problem was that my youtube videos weren't loading. I thought that error had something to do with it. It didn't. I needed to update my youtube code to use version 3 of their api.

I think it won't be hard to combine all of my JS into a single file to avoid the jquery error.

arvgta commented 9 years ago

That's great! Then we'll leave this issue closed... Best of luck!

arvgta commented 6 years ago

This is now more than just a nuissance, because a hard error is being thrown on Microsoft Edge. Therefore re-opening... If it's due to script src="" tags being injected into the head dynamically, has anyone got another idea how to handle dynamic external script injection?

For example, a possible solution could be appending them to the content div instead...