This page explains how to use importScript. But seems to fail on my MW 1.30.
This page has some discussion about deprecation, but seems to conclude that importScript is not deprecated.
This page says to migrate importScript to mw.loader.
The nice thing about importScript is that you can pass a simple page refererence, eg importScript('MyScript.js')
. It appears that mw.loader requires a more complicated url-syntax, eg
mw.loader.load( '/w/index.php?title=MyScript.js&action=raw&ctype=text/javascript' );
Is it deprecated, or soon to be?