Template:Load user script/testcases

Local page

{{Load user script}}

mw.loader.load( '{{subst:localurl:User:Example/Lipsum|action=raw&ctype=text/javascript}}' ); // Backlink: User:Example/Lipsum

{{Load user script/sandbox}}

mw.loader.load( '{{subst:localurl:User:Example/Lipsum|action=raw&ctype=text/javascript}}' ); // Backlink: User:Example/Lipsum

Local page with interwiki prefix

{{Load user script}}

mw.loader.load( '{{subst:localurl:en:User:Example/Lipsum|action=raw&ctype=text/javascript}}' ); // Backlink: en:User:Example/Lipsum

{{Load user script/sandbox}}

mw.loader.load( '{{subst:localurl:en:User:Example/Lipsum|action=raw&ctype=text/javascript}}' ); // Backlink: en:User:Example/Lipsum

Local page with interwiki prefix and colon

{{Load user script}}

mw.loader.load( '{{subst:localurl::en:User:Example/Lipsum|action=raw&ctype=text/javascript}}' ); // Backlink: en:User:Example/Lipsum

{{Load user script/sandbox}}

mw.loader.load( '{{subst:localurl::en:User:Example/Lipsum|action=raw&ctype=text/javascript}}' ); // Backlink: en:User:Example/Lipsum

Non-local page

{{Load user script}}

mw.loader.load( '{{subst:localurl:c:User:Example/Lipsum|action=raw&ctype=text/javascript}}' ); // Backlink: c:User:Example/Lipsum

{{Load user script/sandbox}}

mw.loader.load( '{{subst:localurl:c:User:Example/Lipsum|action=raw&ctype=text/javascript}}' ); // Backlink: c:User:Example/Lipsum

Non-local page with colon

{{Load user script}}

mw.loader.load( '{{subst:localurl::c:User:Example/Lipsum|action=raw&ctype=text/javascript}}' ); // Backlink: c:User:Example/Lipsum

{{Load user script/sandbox}}

mw.loader.load( '{{subst:localurl::c:User:Example/Lipsum|action=raw&ctype=text/javascript}}' ); // Backlink: c:User:Example/Lipsum