The ProBoards JavaScript API is a reference designed to ease the process of developing plugins and codes for ProBoards forums. The functions listed here are all officially supported by ProBoards, and while other functions exist and may work, ProBoards makes no guarantee about forward compatibility of any functions not explicitly listed here.

For more help with anything in the API, the ProBoards Support forum maintains a plugin board that is a popular place for many of the advanced coders on ProBoards to hang out and offer help. You can visit this board here: http://support.proboards.com/board/38/plugins



All functions listed here can be called on any ProBoards page through a simple JavaScript call like so:

pb.NAME_OF_CLASS.NAME_OF_FUNCTION(PARAMETERS);

Keep in mind that some functions, such as the active_ajax_calls function, do not have a class, and can be called by simply dropping the .NAME_OF_CLASS part out of the call:

pb.NAME_OF_FUNCTION(PARAMETERS);



As a more concrete example, let's examine the alert function. Alert is part of the window class, so we call it like this:

pb.window.alert();

But wait! Alert has a required parameter, text. Required parameters must always be passed into a function; the function will either throw an error or won't work correctly without them. We can see that the text parameter is of the type String, so it must be passed in inside of quotes (or double quotes):

pb.window.alert('This is the text of my alert box.');

So now we have a usable alert box. But looking at the function description, we can see that alert can take in three parameters: title, text, and options. Title and options are both optional, and we've already given our box some text. Let's next give the alert box a title. Both of these parameters are Strings, so they must be passed in inside of quotes:

pb.window.alert('Alert Box Title', 'This is the text of my alert box. Look how long it is.');

Now the title and the text show up, but our text is wrapping to a second line and our height is larger than we need. Let's fix that by passing in some options. A quick look at our function description shows that options is an Object. An Object is basically a hash of keys paired with values following a standard JSON syntax. If we want to set our alert box to 400 pixels wide by 125 pixels tall, simply do the following:

pb.window.alert('Alert Box Title', 'This is the text of my alert box. Look how long it is.', { width: 400, height: 125 });

Now that you've seen how to call this function, you should be able to extend these skills to any other function listed in the API. If you get into trouble, you can always post here for help.