[jQuery] getScript() issue under ie6 (undefined variable)
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( myScriptURL, function() {
// execute this code on success
$("div#result").html(myVar.content);
});
and, the script i am loading (@ myScriptURL) 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);
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