For site-wide use, an administrator can add the line below to the wiki's MediaWiki:ImportJS page.
For personal use, add the code snippet below to your global.js page (for use on all wikis) or your common.js page on your wiki (for use on a single wiki). Note that personal JS must be enabled for your account.
Note: In this example, pay close attention to the placement of commas and other punctuation. For people who aren't familiar with programming (and even those who are!), a common mistake when writing code is to accidentally delete, forget, or misplace critical symbols like commas or quotation marks. This can cause a syntax error that breaks the code. Carefully follow the convention shown here when using importArticles.
Source mode is designed to handle complex html codes on an article, allowing to reduce the amount of unwanted code that is sometimes automatically added. Source mode is the best way to edit if you are using templates, or html tags such as <span>, <p>, and <div>. Click "Expand" to learn how to you can switch to this mode and make your code look cleaner.
Here are some useful tips:
When copy or pasting content, always use source mode!
When you see in the edit area of visual mode, it refers to a template, or content with code that is not supported or too complex for the visual editor to handle. In source mode you will see this content in full.
When you see in the edit area of visual mode, it refers to a comment. In source mode, you will see this content as <!-- -->.
MediaWiki has a special language called wikitext to make editing more easy. This language is supported in visual mode and will not break as easily as html.
Some html tags like <u> or <s> are supported in visual mode.
You can also enter source mode when creating or replying to threads in a forum, or when using a message wall by clicking underneath the edit area.