Accessing Joust Properties and Methods

General purpose utility functions

The following functions in index.htm provide some useful general purpose services.

setStatus(theText)
Sets the status message in the browser window containing the text frame. On browsers that do not support the onMouseOut event, it will set a timer to clear the status in 5 seconds.
clearStatus()
Clears the status message in the browser window containing the text frame.
getMode()
Returns a string with the current mode (Frames, Floating, NoFrames).
setMode(theMode)
Sets the current mode to theMode (Frames, Floating, NoFrames). Note that theMode is case sensitive. If an invalid string is supplied, setMode will assume "Frames".
fixPath(p)
In some situations some browsers will return invalid values for the location.pathname property. For example, if the server is using a port other than the default of 80, MSIE 4 will append the port number to the end of the returned path. If the page has been loaded from a local disk instead of from a web server, MSIE (all versions at the time of writing this) will return a path using "\" as a seperator instead of "/". These problems can make it difficult to do things like synchronisation. The fixPath will detect and correct known problems in a supplied URL and return one that is correctly formatted. If your server is using a port other than 80, or your site needs to be used from a disk or CD-ROM, then you should use this function every time you access location.pathname. e.g.:
var pn = fixPath(location.pathname);
getParm(theStr, parm, delim)
Returns a parameter from a list of name=value pairs. This is useful for extracting values from cookies or the location.search parameter. theStr is a string containing the list of name=value pairs. parm is a string containing the name of the parameter you want. delim is a string containing the delimiter separating each name=value pair (cookies use ';' and the search parameter generally uses '&').
pageFromSearch(default, menu, select)
Extracts the 'page' value from the location.search property. If there isn't one the string supplied in default is returned. If there are no name=value pairs in the search property pageFromSearch will assume that the entire search parameter is the page. This is to maintain backwards compatibility with older versions of Joust (and links created for it) which used the search parameter to set the page without the "page=" name now used. The function will then search the menu passed as the second parameter (normally theMenu) for an entry with a matching URL. If found, the menu will be opened to ensure that the entry is visible. If select is true, the entry will be "selected". Pass null in the menu parameter if you don't want the entry made visible or selected.
loadURLInTop(theURL)

Loads the specified URL into the top level window. This is like doing

top.location.href = theURL;

except that it automatically copes with Floating mode.

The Joust Outliner