IE load and ready no loading (again) #274

Closed
dsusco opened this Issue Nov 20, 2013 · 5 comments

Projects

None yet

2 participants

@dsusco
dsusco commented Nov 20, 2013

Was trying to load jQuery in IE (8 specifically) and kept on getting undefined for both of the alerts below. Works fine in everything else though. I tried with both CDN and local copies of Head. I saw that there was a similar issue before.

head.load({jQuery: 'http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js'}, function() {
alert('load callback: ' + typeof $);
});

head.ready('jQuery', function() {
alert('ready: ' + typeof $);
})

@robert-hoffmann
Member

Try this fiddle: http://jsfiddle.net/AF6YM/2/
Page will be broken in IE8, but you should still get the alert()

It uses v1.0.2 and loads jQuery 1.10.2 (remember 2x branch is only compatible with IE9 and up)

http://jquery.com/download/
jQuery 2.x has the same API as jQuery 1.x, but does not support Internet Explorer 6, 7, or 8.

@dsusco
dsusco commented Nov 20, 2013

Crap, sorry. Didn't even think about that. I've been playing with this
script in multiple browsers:

head.load(
[{jQuery: '//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'},
{jQueryUI: '//
ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js'}]
);

head.ready('jQuery', function() {
$('body').append('

jQuery

')
});
head.ready('jQueryUI', function() {
$('body').append('

jQueryUI

')
});
head.ready(['jQuery', 'jQueryUI'], function() {
$('body').append('

JS

')
});
head.ready(function() {
$('body').append('

everything

')
});

I'm assuming that the JS and everything paragraphs don't show up in IE < 10
due to browser limitations?

On Wed, Nov 20, 2013 at 4:46 AM, Robert Hoffmann
notifications@github.comwrote:

Try this fiddle: http://jsfiddle.net/AF6YM/2/
Page will be broken in IE8, but you should still get the alert()

It uses v1.0.2 and loads jQuery 1.10.2 (remember 2x branch is only
compatible with IE9 and up)

http://jquery.com/download/
jQuery 2.x has the same API as jQuery 1.x, but does not support Internet
Explorer 6, 7, or 8.


Reply to this email directly or view it on GitHubhttps://github.com/headjs/headjs/issues/274#issuecomment-28874509
.

Dave

@robert-hoffmann
Member

No not crap for you ..you uncovered a bug ! Crap for me :-)

Array loading, and triggering on array of labels, is bugged in old browsers that use the text/cache hack for loading. Use old style loading syntax for now, i'm working on a fix

@robert-hoffmann
Member

Got it fixed and unit tests are running fine ..but before publishing it, i'd love to get saucelabs setup & configured to prevent this from happening again.

Please test with this file and let me know if all is fine for you: http://headjs.com/dist/1.0.0/head.js

@robert-hoffmann
Member

Fixed in 1.0.3, enjoy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment