Jelle Zijlstra | 1 Aug 2011 13:51
Picon

Re: Loading jQuery

Are you aware that jQuery and jQuery UI are two different things?

2011/8/1 Aran Dunkley <aran <at> organicdesign.co.nz>

> Hello, I'm trying to update some of my extensions to work with the
> ResourceLoader in 1.17, and I can't work out how to get jQuery to load.
> I've tried the example at
>
> http://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_for_extension_developers
>
> and tried adding it directly,
> $out->addModules( array( 'jquery.ui' ) );
>
> But nothing I do will actually get the script to load and become
> available, can anyone tell me the new syntax to get jQuery there?
>
> Thanks,
> Aran
>
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l <at> lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
Aran Dunkley | 1 Aug 2011 13:55
Picon
Gravatar

Re: Loading jQuery

Yes I'm using both jQuery and jQueryUI in some of my extensions and
they've broken in MediaWiki 1.17 because neither of them are being
loaded any more. I've tried many different variations of using
$wgOut->addModules and setting items in $wgResourceModules but no matter
what I do I can't seem to get the jQuery scripts to load. The browsers
error log just says that the $, jQuery and other functions aren't defined.

On 01/08/11 23:51, Jelle Zijlstra wrote:
> Are you aware that jQuery and jQuery UI are two different things?
> 
> 2011/8/1 Aran Dunkley <aran <at> organicdesign.co.nz>
> 
>> Hello, I'm trying to update some of my extensions to work with the
>> ResourceLoader in 1.17, and I can't work out how to get jQuery to load.
>> I've tried the example at
>>
>> http://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_for_extension_developers
>>
>> and tried adding it directly,
>> $out->addModules( array( 'jquery.ui' ) );
>>
>> But nothing I do will actually get the script to load and become
>> available, can anyone tell me the new syntax to get jQuery there?
>>
>> Thanks,
>> Aran
>>
>> _______________________________________________
>> Wikitech-l mailing list
>> Wikitech-l <at> lists.wikimedia.org
(Continue reading)

Roan Kattouw | 2 Aug 2011 08:10
Picon

Re: Loading jQuery

On Mon, Aug 1, 2011 at 1:55 PM, Aran Dunkley <aran <at> organicdesign.co.nz> wrote:
> Yes I'm using both jQuery and jQueryUI in some of my extensions and
> they've broken in MediaWiki 1.17 because neither of them are being
> loaded any more. I've tried many different variations of using
> $wgOut->addModules and setting items in $wgResourceModules but no matter
> what I do I can't seem to get the jQuery scripts to load. The browsers
> error log just says that the $, jQuery and other functions aren't defined.
>
That's very strange. jQuery should definitely be there, otherwise
something is very wrong. I wouldn't know how to debug this without
more information. Is the JavaScript console reporting any JS errors?

Roan Kattouw (Catrope)
Aran Dunkley | 2 Aug 2011 08:36
Picon
Gravatar

Re: Loading jQuery

I've figured it out now thanks :) the problem was that my scripts had
things running inline that needed to be deferred until after the JS
modules had loaded.

On 02/08/11 18:10, Roan Kattouw wrote:
> On Mon, Aug 1, 2011 at 1:55 PM, Aran Dunkley <aran <at> organicdesign.co.nz> wrote:
>> Yes I'm using both jQuery and jQueryUI in some of my extensions and
>> they've broken in MediaWiki 1.17 because neither of them are being
>> loaded any more. I've tried many different variations of using
>> $wgOut->addModules and setting items in $wgResourceModules but no matter
>> what I do I can't seem to get the jQuery scripts to load. The browsers
>> error log just says that the $, jQuery and other functions aren't defined.
>>
> That's very strange. jQuery should definitely be there, otherwise
> something is very wrong. I wouldn't know how to debug this without
> more information. Is the JavaScript console reporting any JS errors?
> 
> Roan Kattouw (Catrope)
> 
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l <at> lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Gmane