-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4474201
By: dastultz
Hi, how can I add my own JavaScript files to all pages. I'm looking for the equivalent to <desktop-config>
<theme-uri>mytheme.css</theme-uri>
</desktop-config>
for JavaScript.
Thanks.
-Daryl
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4475517
By: waterbottle
Hi,
ZK hasn't supported this feature, please post to feature request.
by the way, you can modify the desktop.dsp and add your javascript declaration, it's a template for every desktop.
/Dennis.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4475721
By: jumperchen
Hi Dary,
You can specify the <javascript> in the lang-addon.xml and it will be used in this application.
/Jumper
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4476615
By: dastultz
Ok, I'm not sure whom to believe... :-)
Jumper, could you give an example? I tried putting the line in these 2 forms at the top of my lang-addin.xml but it doesn't work:
<javascript>myfile.js</javascript> (throws EL exception)
<javascript name="myfile.js" /> (no error, but not in HTML)
Thanks.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4476662
By: dastultz
Got it:
This works:
<?xml version="1.0" encoding="UTF-8"?>
<language-addon>
<javascript src="myfile.js" />
...
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4477577
By: waterbottle
Hi, Daryl.
Jumper's reply is the right solution. :) modify desktop.dsp is not usual case.. please forget what I said..
/Dennis
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4477606
By: jumperchen
Hi,
Here is my example,
lang-addon.xml
<language-addon>
<!-- The name of this addon. It must be unique -->
<addon-name>zkdemo</addon-name>
<!-- Which language this addon will be added to -->
<language-name>xul/html</language-name>
<javascript src="/js/test.js" charset="UTF-8"/> </language-addon>
The test.js is put under WebContent/js/ directory.
And then you will see it in the html source as below.
<script type="text/javascript" src="/zkdemo-all/js/test.js" charset="UTF-8"> </script>
Regards,
Jumper
answered 2013-03-07 07:27:13 +0800
This post is a wiki. Anyone with karma >100 is welcome to improve it.
zk support but need to modify zk.xml, then it will be work <language-config> <addon-uri>/WEB-INF/lang-addon.xml</addon-uri> </language-config>
Asked: 2007-08-20 15:31:16 +0800
Seen: 749 times
Last updated: Mar 07 '13