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.
The code adds a checkbox at the top of Special:RecentChanges and Special:Watchlist, next to the header.
Ticking this sets a cookie (specific to each wiki) and starts updating the list.
This occurs silently every 60 seconds without a full page reload occurring.
There are several configuration options:
Pages that are automatically refreshed
Ajax special pages
Special pages that are automatically refreshed (language-neutral)
Interval in which the page is automatically refreshed
60000 (60 seconds)
Text displayed beside the checkbox on the page
Text displayed when hovering over "AJAX"
"Enable page auto-refresh"
If you have functions that modify the content that's reloaded, they won't work after the first refresh unless you run them again after the content has loaded. You can do this by adding them to the ajaxCallAgain variable, like this:
Using configuration options with Fandom Open Source Library scripts