Wikipedia:User scripts/Guide: Difference between revisions

Content deleted Content added
Working with CSS: add edit link
Line 132:
The best and most recommended way to load a JavaScript file during development is from your local web server (see below for an easy way to install a web server). Put this string in your [[Special:Mypage/common.js|/common.js]]:
 
<syntaxhighlight lang="javascript" copy>
mw.loader.load( 'https://localhost/wikipediatest.js' );
</syntaxhighlight>
 
In some environment, you need write this like<ref>https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content</ref>:
<syntaxhighlight lang="javascript" copy>
mw.loader.load( 'http://127.0.0.1/wikipediatest.js' );
</syntaxhighlight>