getScript() issue under ie6 (doesn't execute the script)
Hi,
I'm using getScript to load a script which basically contains a
variable, and then i'm using this variable in the callback function.
It looks like that :
$.getScript( myScript.js, function() {
// execute this code on success
$("div#result").html(myVar.content);
});
and, the script i am loading (myScript.js) is simply :
var myVar = {
content: '<img src="http://awebsite.com/foo.jpg" />'
};
It works fine under FF, Opera and Safari, but it doesn't work under
ie6.
I get this error : "myVar is undefined" at the line which corresponds
to $("div#result").html(myVar.content);
Actually ie6 doesn't execute the script... (if i write alert('test'); in myScript.js, it won't do anything under ie6).
Any idea about how to fix it ?
Has someone already tested this kind of code under ie6 ? Actually i'm
using ie6 via Wine on Ubuntu and i was wondering if this bug only
exists with my version of ie6.
Thanks in advance.
-Olivier