User:JJPMaster/widgets

From Uncyclopedia, the content-free encyclopedia
Jump to navigation Jump to search

Widgets is a script that allows you to embed client-side JavaScript into Uncyclopedia pages. The code will however only run for other people using the script.

Think before installing this script, because it may pose a major security risk.

Features[edit | edit source]

This script allows you to embed JavaScript, but it also has two other things to note:

  1. It comes pre-installed with jQuery, assuming that the default JavaScript doesn't already come with it.
  2. It literally allows you to create entire neural networks and machine learning models within Uncyclopedia. Why, you may ask? I don't even know.
  3. It's only n lines of code, so you can easily steal it for your own wikis!

How do I get it?[edit | edit source]

Just add the following to User:<insert name here>/common.js:

mw.loader.load('//en.uncyclopedia.co/w/index.php?title=User:JJPMaster/widgets.js&action=raw&ctype=text/javascript');

How do I use it?[edit | edit source]

Go to a page, like User:JJPMaster/sandbox, and create a div with the class of "script", like <div class="script">, and then add JS between that and the closing tag. Alternatively, src, html, module, nolib, and embed are a few other div classes you can use, and they do the following:

  1. src - Defines the src attribute in <script> if you want to embed other scripts, like how RedWarn is forcibly loaded for all Widgets users on User:JJPMaster/sandbox
  2. html - Allows you to embed HTML beyond <script>
  3. module - Same as script, except it adds type=module
  4. nolib - Same as script, but it doesn't load any libraries
  5. embed - Allows you to embed anything in your page
  6. tensorflow - The class you need if you want to do machine learning stuff