Talk:JQuery

From MediaWiki.org
Jump to: navigation, search

Contents

Thread titleRepliesLast modified
Turning it on122:04, 25 March 2013
How to disable load /resources/jquery/jquery.js in mediawiki1.17?300:15, 25 March 2013
jQuery load modules problem in mediawiki 1.17?122:37, 8 August 2011
Why jQuery 1.3.2 and not 1.4.2?315:17, 4 August 2011
Using FireQuery and uncompressed jQuery for development209:18, 3 August 2011

Turning it on

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!

86.43.191.21700:21, 25 March 2013

It is loaded automatically by ResourceLoader.

Read/Reply further at Thread:Talk:ResourceLoader/Migration guide (users)/Turning it on?.

Krinkle (talk)22:04, 25 March 2013
 

How to disable load /resources/jquery/jquery.js in mediawiki1.17?

I'd like use google jquery instead of mediawiki's jquery. that will make site load faster.

—The preceding unsigned comment was added by an unknown user on a unknown date.09:18, 3 August 2011

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.

Krinkle22:34, 8 August 2011

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;
 
}
Netsu08:32, 15 December 2012
 

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?

86.43.191.21700:15, 25 March 2013
 
 

jQuery load modules problem in mediawiki 1.17?

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?

Sudosu-w 05:41, 03 Aug 2011 (UTC)09:19, 3 August 2011

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.
Krinkle22:37, 8 August 2011
 

Why jQuery 1.3.2 and not 1.4.2?

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?

Dave 98.248.0.129 03:05, 9 August 2010 (UTC)09:15, 3 August 2011

Because 1.3.2 was the most recent version when 1.16 development was started.

--Skizzerz 04:07, 9 August 2010 (UTC)09:15, 3 August 2011

MediaWiki 1.17 will ship with jQuery 1.4.2

Krinkle 00:45, 22 January 2011 (UTC)09:16, 3 August 2011
 

MediaWiki 1.17 shipped with jQuery 1.4.2.

MediaWiki 1.18 will ship with 1.6.2.

For more info, see jQuery.

Krinkle15:17, 4 August 2011
 

Using FireQuery and uncompressed jQuery for development

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

--Nakohdo 17:06, 10 February 2011 (UTC)09:17, 3 August 2011

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.

Krinkle 14:47, 13 February 2011 (UTC)09:17, 3 August 2011

Thanks for the hint. I will try that as soon as I have upgraded to 1.17 ;-)

--Nakohdo 17:32, 13 February 2011 (UTC)09:18, 3 August 2011