[Jslib] Basic question on use/installation of JSLIB

Stephen Knight stknight at ultralifebatteries.com
Mon Nov 3 16:29:24 EST 2003

Scott Bennyhoff wrote:
> Hello,
> Is it possible to get some help for a very basic level programmer? 
> This may seem basic, but its beyond me for the moment.
> I have started to use a another extension (Macro Editor) and have
> found it very interesting to use.  With help from that author, I have
> been able to make javascript programs that I can use to go through
> the document model and list on an alert window every part of the
> displayed web page.  However, now I would like to extend this
> capability by using javascript to write this output to a file for
> storage.
> First, can JSLIB work in conjunction with this other extension to
> give it the ability to have file I/O?  I have seen code examples on
> this site for JSLIB, but they all seem to be written for XUL, or at
> least a part is.
> I have tried installing the JSLIB.JAR production install to work with
> Firebird.  Based on the installation instructions, I was able to view
> the JSLIB splash screen (using the URL chrome://jslib/content/).  I
> have also extracted the files out of the installed JAR file, so all
> the files are now visible on my computer.
> After this I have tried using the macro editor to load the I/O files,
> with no luck.  Here is a basic example I have done:
> alert('Start of Macro 6');
> load('chrome/jslib/jslib.js');
> alert('jslib has loaded successfully!');
> The first alert runs, but the second alert never runs.  I've tried
> different permutations on the load command with no luck too.  I can
> view and open the jslib.js file, so that seems right.
> Can someone direct me in the right direction?

I'm not familiar with "load" in your context, so have you tried:
<script type="application/x-javascript" src="chrome://jslib/content/jslib.js" />

in your markup-language?

if that works, then after that you should be able to use
include( chrome-filename );

and that will load in "chrome" based files (ie; other jslib files).  However, it doesn't appear 
(qualifiers here) that "include" can load in non-chrome files.  You aren't limited to using 
"include" to bring in jslib files but it does make it easier.

checkout the "[Jslib] example code that doesn't work for me..." discussion, which does provide a 
working example via XUL.  One of the things you have to watch out for is security and the example 
shows how to set that.

hope this helps.

Stephen Knight
Ultralife Batteries, Inc.

More information about the Jslib mailing list