javascript"
m (→merge) |
m |
||
Line 2: | Line 2: | ||
'''Syntax:''' | '''Syntax:''' | ||
− | <javascript package="''pkg_name''" [merge="'''false'''|true"]/> | + | <javascript package="''pkg_name''" [merge="'''false'''|true"] [ondemand="'''false'''|true"/> |
<javascript src="''a_uri''"/> | <javascript src="''a_uri''"/> | ||
Line 29: | Line 29: | ||
For more information, please refer to the [[ZK Developer's Reference/Performance Tips/Minimize the number of JavaScript Files to Load|Performance Tips]] section. | For more information, please refer to the [[ZK Developer's Reference/Performance Tips/Minimize the number of JavaScript Files to Load|Performance Tips]] section. | ||
+ | |||
+ | ==ondemand= | ||
+ | [Optional][Default: false] | ||
+ | |||
+ | It is used to 'cancel' the package specified in another <tt>javascript</tt> element. By default, JavaScript packages are loaded on-demand (i.e., when it is required). By specify <javascript;> in a language definition/addon, we could force some packages to load at the beginning. If you changed the mind, you could either remove the <tt>javascript</tt> element, or specify another <tt>javascript</tt> element with <code>ondemand="true"</code>. | ||
=Version History= | =Version History= |
Revision as of 06:30, 19 November 2010
Syntax:
<javascript package="pkg_name" [merge="false|true"] [ondemand="false|true"/> <javascript src="a_uri"/>
It specifies the JavaScript package or file that has to be loaded to the client. Notice that, if specified, it is always loaded, no matter if it is required or not.
Example,
<javascript package="zul.box"/>
package
[Optional]
It specifies the package to load.
src
[Optional]
It specifies the URI of the JavaScript file to load. The URI could contain ~./ (such as "~./foo/whatever.js") to load a JavaScript file from the classpath.
merge
[Optional][Default: false]
It is used with the package attribute to specify whether the package shall be loaded as part of the zk package. If not specified, each package will be loaded separatedly. It speed up the loading if we merge several packages into one.
For more information, please refer to the Performance Tips section.
=ondemand
[Optional][Default: false]
It is used to 'cancel' the package specified in another javascript element. By default, JavaScript packages are loaded on-demand (i.e., when it is required). By specify <javascript;> in a language definition/addon, we could force some packages to load at the beginning. If you changed the mind, you could either remove the javascript element, or specify another javascript element with ondemand="true"
.
Version History
Version | Date | Content |
---|---|---|