Talk:JQuery
- [History↑]
Contents
| Thread title | Replies | Last modified |
|---|---|---|
| Turning it on | 1 | 22:04, 25 March 2013 |
| How to disable load /resources/jquery/jquery.js in mediawiki1.17? | 3 | 00:15, 25 March 2013 |
| jQuery load modules problem in mediawiki 1.17? | 1 | 22:37, 8 August 2011 |
| Why jQuery 1.3.2 and not 1.4.2? | 3 | 15:17, 4 August 2011 |
| Using FireQuery and uncompressed jQuery for development | 2 | 09:18, 3 August 2011 |
How do you actually turn jQuery on and load modules?
I have a custom pre 1.16 skin and there is absolutely no documentation whatsoever about how to use JQuery, or Resourceloader. They are clearly NOT being loaded by default in Mediawiki 1.19.
I am sick of going back and forth through these awful documentation pages about this. Why was there no migration guide written for custom skins? Functionality is being slowly broken with successive updates and you haven't given us any idea of how to actually go about migrating. If you're going to break functionality, at least tell us how to fix it!
It is loaded automatically by ResourceLoader.
Read/Reply further at Thread:Talk:ResourceLoader/Migration guide (users)/Turning it on?.
I'd like use google jquery instead of mediawiki's jquery. that will make site load faster.
MediaWiki 1.17 comes with ResourceLoader which loads jQuery minified and combined with other files in one request. The gain of loading it from a CDN is minimal at best in this case. Not supported in core.
HA-HA
$wgHooks['SkinAfterBottomScripts'][] = 'fnRemoveAnnoingJS'; function fnRemoveAnnoingJS($skin, &$text) { $n = "\n"; $t = "\t"; $text = $text.'<script language="JavaScript" type="text/javascript"> /*<![CDATA[*/ jQuery.noConflict(true); /*]]>*/ </script>'. $n. '<script type="text/javascript" src="/fileYouWantToWorkWithoutStupidBuggy.1.4.2.js"></script>'; return true; } $wgHooks['ParserBeforeTidy'][] = 'wgAddJquery'; function wgAddJquery(&$parser, &$text) { global $addJqueryScripts; if ($addJqueryScripts === true) return true; $parser->mOutput->addHeadItem( '<script language="JavaScript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>' ); $addJqueryScripts = true; return true; }
JQuery is not loaded by Mediawiki 1.19 and above. Nothing seems to work and there is no documentation on how to make it work.
How and where is jQuery actuially loaded?
Example
Uncaught Error: Unknown dependency: jquery.json
in JavaScript console on chrome. And all modules, using jquery does not works. Anybody know how to fix this issue?
The 'jquery.json' module was added to MediaWiki in version 1.18. Looks like you're using something that wasn't designed for MediaWiki 1.17. Perhaps you downloaded an extension from /trunk/ ? If so: either:
- download an old version of the extension from /branches/REL1_17/extensions/;
- or, wait until MediaWiki 1.18 or 1.19 is released (1.18 is scheduled for beta-release around September/November)
- or, use MediaWiki from /trunk/ as well. note that trunk is not reviewed or stable. Not recommended for production/live wikis.
Is there a particular reason why jQuery 1.4.2 wasn't used for mediawiki 1.16? Was there a problem with jQuery 1.4.2 that caused you to use the one year older 1.3.2?
Because 1.3.2 was the most recent version when 1.16 development was started.
MediaWiki 1.17 will ship with jQuery 1.4.2
I'd like to use Firefox add-on FireQuery for jQuery development but haven't come very far yet. I suppose the problem is the minified jQuery which isn't very useful for development purposes. Is there a way to use the uncompressed version of jQuery for development? TIA
I don't know FireQuery, but as of 1.17 the ResourceLoader is serving all resources (minified by default). Append "?debug=true" or "&debug=true" to the end of a link to disable it. Then all raw modules will be loaded. In your development please use mw.log where you would otherwise do a check for your own debug mode and use console.log. mw.log is a built-in function that will either do nothing in production mode or (in debug mode) send messages to your console (if available) or in a logger-element on the page. See also RL/DM#mediaWiki.log.
Thanks for the hint. I will try that as soon as I have upgraded to 1.17 ;-)