[Jslib] include is not defined

Ivan Volf insys at st.t-com.hr
Mon Feb 12 02:32:11 PST 2007


Linux,  firefox 1.5.3 :
I have globally installed jslib_current_static_signed.xpi.

In this text example :

<?xml version="1.0" ?>
<!DOCTYPE window>
<window id="jslib-test"
style="background-color: #cccccc; width: 100px; height: 100px;"
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"> 
 include ('chrome://jslib/content/io/file.js');
// include (jslib_file);
// a local file path
var localFile = "/tmp/fubar.dat";
var f = new File(localFile);

function jslibCheckInst ()
{
  if (typeof(jslib) != "object") {
    const msg = "MyExtension requires jsLib to properly operate\n"
              + "Would you like to install jsLib now? (browser restart 
required)";

    if (confirm(msg)) {
      const url = "http://www.mozdevgroup.com/dropbox/jslib/signed/"
                + "jslib_current_global_signed.xpi";
      try {
        _content.location = url;
      } catch (e) { open(url, "_blank", "width=1,height=1"); }
    }

    throw "Stopping any further code execution ...";
  }
}
</script>
<vbox flex="1" pack="center">
<spacer flex="1" /> <button label="verzija" 
oncommand="alert(JS_LIB_VERSION);" />
<spacer flex="1" />
<spacer flex="1" /> <button label="Install test" 
oncommand="jslibCheckInst ();" />
</vbox >
<vbox flex="1" pack="center"> 
<spacer flex="1" /> 
<button label="Function List" oncommand="alert(f.help);" /> 
<button label="exists" oncommand="alert(f.exists());" /> 
<button label="create file" oncommand="if (!f.exists()) f.create();" /> 
<spacer flex="1" />
</vbox>
</window>

after loading page there is an error :

Error: include is not defined
Source File: http://localhost/test/jslib.xul
Line: 10

Please, if somebody can help me to solve this problem.
Thanks


More information about the Jslib mailing list