How controlled is the environment? Many browsers can be configured that
scripts from a specific domain may load data from another domain via
XMLHttpRequest. Please don't ask me for details now, but I had that
problem
once in an environment with only IE 6.


Not that controlled. I mean I'm generating the content on both servers, so I
can make them play together however I want. It's just an exercise in
coercing the browsers into letting it happen.

if($.browser.msie) {
>     script = document.createElement('script');
>     script.type = 'text/javascript';
>     script.src = url;
>     document.getElementsByTagName("body")[0].appendChild(script);
> } else {
>     $('body').append('<script type="text/javascript" src="' + url +
> '"></script>');
> }

Is there a good reason, why you distinguish between IE and real browsers
here?
I'd think, that both variants should work in both cases.


The .append() version doesn't work in IE6/WinXP. Just tested it again to be
sure. I assume the manual way would work in all browsers, and I'll probably
switch over to using just that eventually. I just hate writing ugly code to
compensate for IE.

I just assumed $.getScript() would deal with it. Functionally, is there a
> difference between adding the script to body vs head? Thanks for all the
> info.

Well, if you add it to the body it might be in your way when working on
the
content via DOM or jQuery. I like to have stuff like that in the head.
Functionally there should be no difference.


Yeah, good call, head does seem cleaner. I'll switch over to that. Thanks!

--Erik
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to