[Jslib] problem with FileUtils.spawn()

gk gerryk at kaltel.com
Sun Aug 24 18:41:32 EDT 2003


Using the following code as a test, I've had these results:
JS_LIB_VERSION = 0.1.83
JS_LIB_BUILD = mozilla 1.3+
JS_LIB_LOADED = true
jslib_fileutils = undefined

When I click on the Xterm button I get 'include is not defined' in the 
JS console window.

I've tried this with both the JAR and Developers builds. Installed as 
both root and normal users.

I hope someone spots what I'm doing wrong, because I can't see it.

thanks

Gerry


<?xml version="1.0"?>
 

<!DOCTYPE window>
 

<window
         id="jslib-test"
         style="background-color: #cccccc; width: 100px; height: 100px;"
         xmlns:html="http://www.w3.org/1999/xhtml"
 
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 

<script type="application/x-javascript" 
src="chrome://jslib/content/jslib.js" /> 

<script type="application/x-javascript">
 

function test() {
         include(jslib_fileutils);
         var fu = new FileUtils();
         fu.spawn('/usr/X11R6/bin/xterm');
         return;
}
</script>
 

<vbox flex="1" pack="center">
         <spacer flex="1" />
         <button label="Test" oncommand="alert(JS_LIB_VERSION);" />
         <button label="Xterm" oncommand="test();" />
         <button label="Test 2" 
oncommand="alert(JS_LIB_BUILD+JS_LIB_LOADED+jslib_fileutils);" />
         <spacer flex="1" />
</vbox>
</window>



More information about the Jslib mailing list