[Jslib] Re: file and class structure
Eric Plaster
plaster@talkware.net
Fri, 11 May 2001 13:36:39 -0500
--------------7221CB4FC820022F538D7E25
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cool! This will go well in my project. Now if they only fix bug #7515 (yes
it's been around for a few years :) I could truely change theme/behavior of
my app based on a menu option...
pete collins wrote:
> > The only problem that I see, is we have no way of including another js
> > file.
>
> Sure there is:
>
> const Include=new
> Components.Constructor('@mozilla.org/moz/jssubscript-loader;1',
> 'mozIJSSubScriptLoader');
>
> const include = new Include();
>
> dump("this is a test");
>
> include.loadSubScript('chrome://jslib/content/my_included_js_file.js');
>
> The only catcher is that you need a full path to the file being included.
>
> --pete
--
----
Eric Plaster Universal Talkware Corp
Senior Software Engineer (612)843-6711
plaster@talkware.net http://www.talkware.net
--------------7221CB4FC820022F538D7E25
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<br>Cool! This will go well in my project. Now if they only
fix bug #<a href="http://bugzilla.mozilla.org/show_bug.cgi?id=7515">7515</a>
(yes it's been around for a few years :) I could truely change theme/behavior
of my app based on a menu option...
<p>pete collins wrote:
<blockquote TYPE=CITE>> The only problem that I see, is we have no way
of including another js
<br>> file.
<p>Sure there is:
<p>const Include=new
<br>Components.Constructor('@mozilla.org/moz/jssubscript-loader;1',
<br>'mozIJSSubScriptLoader');
<p>const include = new Include();
<p>dump("this is a test");
<p>include.loadSubScript('chrome://jslib/content/my_included_js_file.js');
<p>The only catcher is that you need a full path to the file being included.
<p>--pete</blockquote>
<pre>--
----
Eric Plaster Universal Talkware Corp
Senior Software Engineer (612)843-6711
plaster@talkware.net <A HREF="http://www.talkware.net">http://www.talkware.net</A></pre>
</html>
--------------7221CB4FC820022F538D7E25--