PDA

View Full Version : include javascript file


goto
04-01-2004, 12:28 PM
It's possible to include/import SomeJavaScript.js file into the .lzx, or I need to write it as 'Library' file?

antun
04-01-2004, 12:42 PM
You'd have to write it as a library file.


<library>
<script>
....
</script>
</library>


-Antun

ows
04-02-2004, 06:33 PM
You can also include the script file directly, by using the src attribute of the <script> tag:


<canvas>
<script src="SomeJavaScript.js"/>
</canvas>


BTW, since LZX implements the XInclude XInclude (http://www.w3.org/TR/xinclude/) standard, you could use <include> instead:

<canvas debug="true">
<script>
<include href="SomeJavaScript.js" type="text"/>
</script>
</canvas>


This is just plain silly for including a script file, but can be useful for including a block of text from another file:

<canvas debug="true">
<text>
<include href="content.txt" type="text"/>
</text>
</canvas>

goto
04-05-2004, 07:36 AM
Thanks a lot!
Very helpful!