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)


 * I added your line. Popups arent working for me but maybe they will for you.
 * Granpa (talk) 17:26, August 26, 2012 (UTC)

Staff originally told me to add
 * importScriptURI( 'http://help.wikia.com/index.php?title=MediaWiki:Gadget-popups.js&action=raw&ctype=text/javascript' );
 * importStylesheetURI( 'http://help.wikia.com/index.php?title=MediaWiki:Gadget-navpop.css&action=raw&ctype=text/javascript' );
 * Granpa (talk) 17:42, August 26, 2012 (UTC)
 * Navigation popups are still working over at help wiki http://help.wikia.com/wiki/Special:Random
 * You have to enable them in preferences under gadgets.
 * Granpa (talk) 17:46, August 26, 2012 (UTC)


 * The popups are working fine for me. Maybe there's something else entirely that prevents them from working for you... Please use Chrome and open the developer console while you load one of the page where they should work. Then post any error messages you get here. Alternatively you can use Firefox but then you'd have to install Firebug first.

I opened tools then developer something then errors. I loaded a very small page at http://religion.wikia.com/wiki/Eternal_life and got this: (Here is a screenshot:http://img210.imageshack.us/img210/2803/errorsbx.png)

The text is copied below