[Mediawiki-l] add new js.file

Jim Hu jimhu at tamu.edu
Fri Aug 31 18:24:44 UTC 2007


A lot of the js problems in Safari 2 are much better in Safari 3, but  
I believe that's still beta and has other beta issues.  It's my main  
browser these days.

Jim

On Aug 31, 2007, at 11:48 AM, Jim Wilson wrote:

>> According to a comment in the scriptalicious code, Safari 2 won't  
>> work
>> with this
>
> Yeah, I see what you mean.  That's too bad :(
>
> Well, I guess the most compatible way to do it then is this:
>
> document.write('<script type="text/javascript" src="
> http://path/to/external/file.js"></script>');
>
> -- Jim
>
> On 8/31/07, Jim Higson <jh at 333.org> wrote:
>>
>> Jim Wilson wrote:
>>
>>> If you want to be really slick about it, you could try adding the
>>> following to the article [[MediaWiki:Common.js]]
>>>
>>> (function(){
>>> var s = document.createElement('script');
>>> s.src = "http://path/to/external/file.js";
>>> document.getElementsByTagName('head')[0].appendChild(s);
>>> })();
>>>
>>> This will dynamically create the equivalent of this:
>>>
>>> <script src="http://path/to/external/file.js"></script>
>>>
>>> To your the document head.
>>
>> IIRC, According to a comment in the scriptalicious code, Safari 2  
>> won't
>> work
>> with this, so you have to use the bad old document.write instead.
>>
>> Haven't tested it myself.
>>
>> --
>> Jim
>>
>>
>>
>> _______________________________________________
>> MediaWiki-l mailing list
>> MediaWiki-l at lists.wikimedia.org
>> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at lists.wikimedia.org
> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l

=====================================
Jim Hu
Associate Professor
Dept. of Biochemistry and Biophysics
2128 TAMU
Texas A&M Univ.
College Station, TX 77843-2128
979-862-4054




More information about the MediaWiki-l mailing list