MiniBB JavaScript (part one)

Unlike most of the rest of this script where only relatively minor changes are required to bring the script into the 21st century, the JavaScript that this forum uses really needs to be completely replaced. Since the whole point of using this script rather than writing our own is to be able to implement a forum quickly and rewriting all the JavaScript would take a significant amount of time, we'll instead keep some of the existing JavaScript and to start with we'll just replace the parts of the scripts that are completely broken in modern browsers or which use extremely antiquated code where it can be quickly replaced by a more modern equivalent.

In this particular update to the miniBB JavaScript we'll get rid of the browser sensing and JavaScript included inside href attributes (which were considered to be obsolete even in Netscape 2), the document.write statements, and noscript tags (obsolete since the death of Netscape 4) and replace the alert statements (which modern browsers expect you to only use for debugging). There are also a couple of prompt calls which are not being used for debugging but we'll leave those for the moment as what I have in mind for the second phase of the JavaScript changes will get rid of them.

There are also a number of completely broken pieces of JavaScript that we will resolve in this first update.

Making these changes fixes the broken parts of the script either by replacing them with code that actually works or by removing the broken functionality so that it no longer appears broken. It also removes some of the opportunities that visitors to the forum will have to turn off JavaScript completely when the first alert appears (although they can still get easy access to turn off all the JavaScript by simply requesting to insert a link or image). We are also one step closer to being able to making the JavaScript less obtrusive.

To update your copy of miniBB to apply this first lot of updates to the JavaScript simply download the updated file and upload it to your site in place of the current one. As almost all of these changes are to template files these changes should continue to work with future versions of miniBB but of course there are no guarantees that this will be the case.

 

This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow
Donate