Admin Forum:ImportScriptPage

I just added a little widget module I wrote to the dev wiki. Looking at the code of other entries I found this mysterious JavaScript function named.

What it's supposed to do is fairly obvious but it just doesn't do it for me. Do I lack the permissions? Is there somebody I need to talk to? Or does the function work but there's a scoping issue? Or a timing issue?

Here's what the code looks like:

importScriptPage('InfoWidgets/code.js', 'dev'); $(function {     if ($('#sandbox').length) {         s = Widgets.stubs;         s.selector = '#sandbox';         Widgets.add(s);         Widgets.start;     } });

I should probably add that the widgets work fine on my own machine - without importScriptPage of course. They even work fine here on our landing page - also without importScriptPage.

But when I try to import from the dev wiki I get the error message "Widgets is not defined".

Pecoes 06:57, February 18, 2012 (UTC)