Why is it when I use the XHTML property async=’async’, the Javascript loads on Firefox, Safari and Chrome, but not Internet Explorer and MS Edge?


Why is it when I use the XHTML property async=’async’, the Javascript loads on Firefox, Safari and Chrome, but not Internet Explorer and MS Edge?

I have the following line in my site's code:

 <script src='http://ift.tt/1ZGUyTY; type='text/javascript'/> 

Now, to improve loading efficiency, I read that I should add an async='async' property to this. It turned out to be true. By just doing this, I gained two points in the Google Page Load Speed test.

I tested it on Firefox (desktop) and my iPad's Safari browser. Worked just fine. I then tested it on my Windows Phone's Edge browser…again, worked fine. Went to desktop Chrome, and once more, fine….BUT, when I went to Edge (desktop), the Javascript simply failed to load. I see a huge empty space where it was supposed to load. I tried on Internet Explorer on the same PC and the same issue. Went to my laptop and tried…and same thing.

Can somebody have any idea why this is the case? The moment I remove the async='async' part from the line above, the Javascript starts loading fine on IE/Edge.

Please do help.

TQ

Submitted January 18, 2016 at 11:06PM by himmatsj
via reddit http://ift.tt/1Rwc60h