[HOME] jsMath (Authors) [Prev][Up][Skip][Next]

The CHMmode plugin

This is a mode specifically designed for use the the Microsoft Help system and its associated help file compiler, which produces compressed help files with a .chm extension. The Microsoft help system uses Internet Explorer as its rendering engine, so jsMath can be used to display mathematics within the help pages it generates.

Because the help files are local files (rather than coming from a network server), they cannot have cookie data associated with them, and so jsMath can't store the control panel settings, which makes it hard for the user to make changes to those settings. (They can be set for a single page, but will be lost when you link to another page.)

JsMath's Global Mode can be used to overcome this problem (at least to some extent). This mode allows jsMath to simulate the effect of a cookie that is persistent from page to page (and in addition, it makes the equation cache persistent across pages as well, speeding up the response time for jsMath). You probably don't want the user to be able to enter and leave Global Mode, however, and it usually would be inappropriate to allow the Global Control Bar to be visible, so the CHMmode disables the buttons that allow changes between local/global modes and hidding or showing the control bar. This should make the user's experience more seemless.

To use the CHMmode plugin, include the line

    <SCRIPT SRC="path-to-jsMath/plugins/CHMmode.js"></SCRIPT>
just before the command that loads jsMath.js itself (and after setting the jsMath variable, if you have to do that). You should include this line in every file that loads jsMath. As the user links from one file to another, the global frame will maintain the jsMath settings so they remain in effect as the page changes.

There is one hitch, however: if the user clicks in the table of contents, or moves to another page by a means other than clicking on a link in the document window, the help system will load the document at the top level (i.e., in place of the global frame), and so the settings will be lost. If the page includes jsMath, the CHMmode plugin will load the Global mode again, but the old settings will have been discarded, and they will revert to their defaults. Unfortunately, there is no obvious workaround for this.

In fact, there appears to be a bug with the hh.exe executable that underlies the Windows help system where if the user clicks in the table of contents, then when the help viewer is closed, hh.exe does not exit and consumes 100% of the available CPU time. Because of this, and the problems listed above, you would be wise not to use the automatic table of contents (you can customize the help interface when you create your .cfm file), but instead create your own HTML-based table of contents.


Get jsMath at SourceForge.net. Fast, secure and Free Open Source software downloads [HOME] jsMath web pages
Created: 02 May 2006
Last modified: 21 Mar 2007 21:55:36
Comments to: dpvc@union.edu
[Next] The spriteImageFonts plugin
[Skip] Browser Support for jsMath
[Up] Information for jsMath Authors
[Prev] The noCache plugin