Last modified: 2012-04-16 09:16:15 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T36482, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34482 - Global JavaScript not loading on some sites
Global JavaScript not loading on some sites
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-17 21:11 UTC by Hazard-SJ
Modified: 2012-04-16 09:16 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Hazard-SJ 2012-02-17 21:11:15 UTC
My global javascript at [[m:User:Hazard-SJ/global.js]] Is only loading on some sites, like [[en:]] and [[commons:]], but not sites like [[simple:]], [[meta:]], and [[testwiki:]] which have been updated to 1.19wmf1.
Comment 1 Sam Reed (reedy) 2012-02-17 21:16:32 UTC
Do you get any errors?
Comment 2 Mark A. Hershberger 2012-02-18 02:26:21 UTC
I can load and execute a global.js from meta with just:

  alert("hi!");

I suspect there are some Resource Loader problems in your code.

These will need to be fixed, or your code will probably stop working.  I suspect the problem is with this function:

  function importAnyScript(lang,family,script) {
	document.write('<script type="text/javascript" src="' + 'http://'
		+ lang + '.'
		+ family + '.org/w/index.php?title='
		+ script + '&action=raw&ctype=text/javascript"></script>');
  }

You probably want to replace that with:

  function importAnyScript(lang,family,script) {
	mw.loader.load('//' + lang + '.' + family
		+ '.org/w/index.php?title='
		+ script + '&action=raw&ctype=text/javascript');
  }

In fact, when I copied your global.js, and replaced your importAnyScript() function with my version, it worked.
Comment 3 Hazard-SJ 2012-02-22 03:33:55 UTC
Thanks.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links