Template talk:Js

Interwiki:

</script>

Could someone please change </script> to </s'+'cript>? It's breaking 'show preview' on monobook.js, because when the browser comes across the </script> in the string it assumes it's the end of the script and prints an error message. --ais523 09:54, 1 November 2006 (UTC)

Done. NCurse work 15:00, 1 November 2006 (UTC)Reply

importScript

{{editprotected}} There is now a way of accomplishing this using site-wide JS, which simplifies and shortens the template. Could the whole template, apart from the noinclude section, be changed to this:

importScript('{{{1}}}'); //[[{{{1}}}]]

Thanks. --ais523 09:09, 20 February 2007 (UTC)

I've mentioned this at Wikipedia talk:WikiProject User scripts in the hopes of getting more eyes on this (especially eyes who know Javascript a lot better than I do). – Luna Santin (talk) 22:27, 21 February 2007 (UTC)Reply
Yes, I think this change would work. Tra (Talk) 00:26, 22 February 2007 (UTC)Reply
Done. Awyong J. M. Salleh 14:00, 25 February 2007 (UTC)Reply
Please remove the first line (// Script from [[{{{1}}}]]). When the import code was three lines, it made sense to have that on a fourth, but now it should be on the same line, and already is. — Randall Bart 16:34, 9 March 2007 (UTC)Reply

Also most of the decription can be replaced with link Wikipedia:Monobook. — Alex Smotrov 16:55, 9 March 2007 (UTC)Reply

Documentation

{{editprotected}}

Done the first, only half done the second. It won't need protecting unless it gets targeted for vandalism. Cheers. lifebaka (talk - contribs) 14:57, 25 July 2008 (UTC)Reply

Edit request on 24 April 2013

The text should be replaced with:

mw.loader.load('//en.wikipedia.org/w/index.php?title={{<includeonly>subst:</includeonly>urlencode:{{{1}}}}}&action=raw&ctype=text/javascript'); // [[{{{1}}}]]

importScript is now deprecated, and should be replaced with mw.loader.load.

Legoktm (talk) 08:14, 24 April 2013 (UTC)Reply

Done. --Closedmouth (talk) 09:17, 28 April 2013 (UTC)Reply
Sorry I made a mistake, the internal urlencode needs to get subst'ed. The new code should do it. Legoktm (talk) 18:27, 1 May 2013 (UTC)Reply


importScript() in not really deprecated, please revert the change. See mw:Thread:Talk:ResourceLoader/JavaScript_Deprecations/importScript(),_importStylesheet() and mw:ResourceLoader/JavaScript_Deprecations#wikibits.js. --V111P (talk) 21:03, 10 November 2013 (UTC)Reply

I believe he must mean to revert this diff, in particular, change mw.loader.load('//en.wikipedia.org/w/index.php?title={{<includeonly>subst:</includeonly>urlencode:{{{1}}}}}&action=raw&ctype=text/javascript'); // [[{{{1}}}]]<noinclude> back to importScript('{{{1}}}'); //[[{{{1}}}]]<noinclude>.
Why? Because according to T27845#297475, until T36958 is implemented, we should just keep on using importScript: it will not be deprecated until such time. (Also, the code we have now is unreadably ugly.) —SamB (talk) 21:10, 8 April 2015 (UTC)Reply
Not done: please establish a consensus for this alteration before using the {{edit protected}} template. Since I oppose going backwards to a version where the code is slated to become obsolete, and Legoktm is one of the core developers working on deprecating this old method, I don't think it is wise or desirable to revert this change. — {{U|Technical 13}} (etc) 22:33, 11 April 2015 (UTC)Reply

Edit request to complete TfD nomination

Template:Js has been listed at Templates for discussion (nomination), but it was protected, so it could not be tagged. Please add:

<noinclude>{{subst:tfm|help=off|1=Load user script}}</noinclude>

to the top of the page to complete the nomination. Thank you. Qwerfjkltalk 14:38, 28 November 2021 (UTC)Reply

 Donexaosflux Talk 15:31, 29 November 2021 (UTC)Reply

Protected edit request on 12 December 2024

Please replace the content of {{Js}} with that of {{Js/sandbox}}, which improves the functionality of this template for importing scripts from other Wikimedia projects. JJPMaster (she/they) 22:26, 12 December 2024 (UTC)Reply

 Done * Pppery * it has begun... 18:06, 25 December 2024 (UTC)Reply

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.