Home arrow XML arrow Page 3 - Back to XUL: Completing the JavaScript Logic

Back to XUL: Completing the JavaScript Logic

The previous article saw us complete the File menu, making use of XPCOM to handle some of the more complex behaviors. This article will go on to discuss adding behavior to the two remaining menus, the Edit and Help menus.

Author Info:
By: Dan Wellman
Rating: 5 stars5 stars5 stars5 stars5 stars / 2
February 13, 2006
  1. · Back to XUL: Completing the JavaScript Logic
  2. · Defining a Function
  3. · The Help Menu
  4. · The About Window
  5. · Making the Toolbar Work
  6. · Finishing up the Functions

print this article

Back to XUL: Completing the JavaScript Logic - The Help Menu
(Page 3 of 6 )

Now that the Edit menu is complete, we can get to work on the help menu.   Creating a fully-fledged help system is beyond the scope of this article; however, there are several ways in which a competent help system could be implemented with considerable ease.  Perhaps the simplest way to do this would be to set up a standard HTML page (or series of pages) that listed the functions of the editor and perhaps an installation guide. In the same way that we opened the template files earlier, we could just load the HTML help file into the document window. 

This method however, does have its drawbacks; any document that is open in the text editor is replaced, and the HTML document is editable.  A better way is to simply call the window.open method and open the help document in the main Mozilla browser:

function launchHelp() {

  var sURL = "help.html";
  var sURLName = "helpwin";
  var helpwin = window.open(sURL, sURLName);


Add the oncommand event handler to the main XUL file and then test it out.  Click on Help Help Contents and watch in awe as Mozilla fires up and displays your help system.  The example help.html file included with this article is simply to demonstrate this effect and has, in fact, no help documentation in it.  You could really go to town with this, though, and add as part of the help system a guide to XUL itself; element and component descriptions; examples; and perhaps links to some of the better XUL and Mozilla Developer sites.  Just do what feels right.

blog comments powered by Disqus

- Open XML Finally Supported by MS Office
- XML Features Added to Two Systems
- Using Regions with XSL Formatting Objects
- Using XSL Formatting Objects
- More Schematron Features
- Schematron Patterns and Validation
- Using Schematron
- Datatypes and More in RELAX NG
- Providing Options in RELAX NG
- An Introduction to RELAX NG
- Path, Predicates, and XQuery
- Using Predicates with XQuery
- Navigating Input Documents Using Paths
- XML Basics
- Introduction to XPath

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials