[Mediawiki-l] Adding Scripts to a Page

Richard Minerich richard.minerich at gmail.com
Fri Jun 2 20:15:15 UTC 2006


I am currently working on an extension for MediaWiki and am having some
trouble getting scripts into the <head>
it seems as though $wgOut->addScript() does not work in the following case:


$wgExtensionFunctions[] = 'liveLocal_Install';

function liveLocal_Install()
{
    global $wgParser, $wgHooks;
    $wgParser->setHook("llmap", 'liveLocal_Render');
}

function liveLocal_Render($source, $argv)
{
    global $wgParser, $wgTitle, $wgOut, $wgliveLocalDefaults, $wgJsMimeType,
$wgliveLocalOnThisPage;

....

    $wgOut->addScript( "<script src=\"
http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js\<http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js/>"
type=\"{$wgJsMimeType}\"></script>\n" );

...

}

I am unsure if it is because the timing of when I call addScript or what.
Any help would be greatly appreciated.

-Richard Minerich



More information about the MediaWiki-l mailing list