Forum:Import script for navigation popups only works in certain positions

Here is the link to our sitewide js page:http://religion.wikia.com/wiki/MediaWiki:Wikia.js

It consisted of a few js functions used for some buttons that are on a few pages

then some variables are defined for the statcounter

then the statcounter is imported

then navigation popups is imported.

navigation popups will not work if its import line is placed above the functions

nor will it work if its import line is placed below the statcounter import line

Can anyone shed any light on this behavior.

Granpa (talk) 13:48, August 26, 2012 (UTC)


 * Best I can figure out is that the popups script isn't designed to work on anything other than Wikimedia projects. It contains broken references to variables which don't exist on Wikia; as soon as it hits that point, everything stops due to the error. Try adding:


 * before the  for the popup script. See if that helps. It's hard to tell as everything seems to work right now, if it was still broken I could investigate more deeply. Lunarity 14:49, August 26, 2012 (UTC)


 * It was working earlier but it has mysteriously stopped working now.
 * I added the code above but it had no effect.
 * Granpa (talk) 15:14, August 26, 2012 (UTC)


 * I reverted to an earlier revision that I know was working earlier but it still doesnt work.
 * I have no idea whats going on.
 * Granpa (talk) 15:26, August 26, 2012 (UTC)


 * Its working in chrome but not in firefox.
 * Granpa (talk) 15:28, August 26, 2012 (UTC)


 * control f5 and its working in firefox.
 * I've been using shift reload but maybe that doesnt work anymore
 * Granpa (talk) 15:29, August 26, 2012 (UTC)

OK, everything is back exactly where it was when I first started this thread and popups are working Granpa (talk) 15:35, August 26, 2012 (UTC)
 * and now it has mysteriously stopped again even though I didnt do anything.
 * Granpa (talk) 15:54, August 26, 2012 (UTC)
 * and this is quite typical.
 * this sort of thing happens all the time
 * it works then I change one unrelated thing and it stops
 * then I change it back to exactly where it was before and it still wont work.
 * its totally flaky
 * Granpa (talk) 15:56, August 26, 2012 (UTC)


 * I tried loading this version: manually and it came up correctly without any errors for me. The statement I gave you won't have an overt effect, it just prevents the script from crashing; that   statement needs to be before the popup script is loaded, as long as you keep those 2 together in the same order than it should work. Make sure you're refreshing your cache correctly as well, otherwise the changes you make won't take effect until some time afterwards. Lunarity 16:31, August 26, 2012 (UTC)