XWidgetSoft Forum
http://bbs.xwidget.com/

HELP: include script - possible?
http://bbs.xwidget.com/viewtopic.php?f=8&t=3446
Page 1 of 1

Author:  yereverluvinuncleber [ 2013年 Aug 3日 16:22 ]
Post subject:  HELP: include script - possible?

Is it possible to include any other file containing javascript code?

include("vitality.js");
include("volume.js");
include("functions.js");

Author:  yereverluvinuncleber [ 2013年 Aug 6日 06:33 ]
Post subject:  Re: include script - possible

It would be nice to get an answer to this one, so I am assuming this function does not exist and that I need to pull all the code into one file, script.js.

If this is the case then I'd make it a feature request to 'include' this functionality. Each included script file would appear in a tab in the editor window.

Author:  digigamer [ 2013年 Sep 22日 23:04 ]
Post subject:  Re: HELP: include script - possible?

Possible but not as straightforward as you describe here. include() is not supported in MS Script Host. See MSDN for more details about that.
However, it may be possible by adding the references to the script file in the widget xul (main.xul) file. The XUL file format allows that. Simply open up the file in a text editor and add your script file(s).
Code:
<script src="somefile.js"/>


However, I've never tested this and this feature depends on the XWidget XUL parser. Hope it helps! :)

Author:  Tony [ 2013年 Sep 23日 04:10 ]
Post subject:  Re: include script - possible

yereverluvinuncleber wrote:
It would be nice to get an answer to this one, so I am assuming this function does not exist and that I need to pull all the code into one file, script.js.

If this is the case then I'd make it a feature request to 'include' this functionality. Each included script file would appear in a tab in the editor window.



Hi, you can check this TODOList widget, it's script add two js files: http://www.xwidget.com/xwidget/widgets/ ... 2/421.html
put this code at first line of script:
Code:
eval(readFile(WidgetPath + "other_script.js"));

Author:  yereverluvinuncleber [ 2013年 Sep 23日 11:48 ]
Post subject:  Re: HELP: include script - possible?

Thanks ever so - it will really simplify some of my code to allow .js inclusion - will give it a try and let you know how I get on.

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/