Script"
From Documentation
Tmillsclare (talk | contribs) m (Created page with 'init') |
Jumperchen (talk | contribs) m |
||
Line 1: | Line 1: | ||
− | + | {{ZKComponentReferencePageHeader}} | |
+ | |||
+ | = Script = | ||
+ | *Demonstration: N/A | ||
+ | *Java API: <javadoc>org.zkoss.zul.Script</javadoc> | ||
+ | *JavaScript API: <javadoc directory="jsdoc">zul.utl.Script</javadoc> | ||
+ | |||
+ | = Employment/Purpose = | ||
+ | The script component is used to specify the script codes running at the browser. Notice that, unlike zscript, the script codes are running at the browser. They are usually written in JavaScript which is supported by the most of browsers. The simplest format is as follows. | ||
+ | |||
+ | |||
+ | = Example = | ||
+ | |||
+ | [[Image:ZKComRef_Script_Example.png ]] | ||
+ | |||
+ | <source lang="xml" > | ||
+ | <zk> | ||
+ | <window id="win"> | ||
+ | <button label="change color" onClick='Clients.evalJavaScript("myfunc()")' /> | ||
+ | </window> | ||
+ | <script type="text/javascript"> | ||
+ | function myfunc() { | ||
+ | $e("${win.uuid}").style.backgroundColor = "blue"; | ||
+ | } | ||
+ | </script> | ||
+ | </zk> | ||
+ | </source> | ||
+ | |||
+ | =Supported events= | ||
+ | |||
+ | {| border="1" | width="100%" | ||
+ | ! <center>Name</center> | ||
+ | ! <center>Event Type</center> | ||
+ | |- | ||
+ | | None | ||
+ | | None | ||
+ | |} | ||
+ | |||
+ | =Supported Children= | ||
+ | |||
+ | *NONE | ||
+ | |||
+ | =Use cases= | ||
+ | |||
+ | {| border='1px' | width="100%" | ||
+ | ! Version !! Description !! Example Location | ||
+ | |- | ||
+ | | 5.0+ | ||
+ | | | ||
+ | | | ||
+ | |} | ||
+ | |||
+ | =Version History= | ||
+ | |||
+ | {| border='1px' | width="100%" | ||
+ | ! Version !! Date !! Content | ||
+ | |- | ||
+ | | 5.0.1 | ||
+ | | 04/30/2010 | ||
+ | | Initialization | ||
+ | |} | ||
+ | |||
+ | {{ZKComponentReferencePageFooter}} |
Revision as of 08:04, 30 April 2010
Script
Employment/Purpose
The script component is used to specify the script codes running at the browser. Notice that, unlike zscript, the script codes are running at the browser. They are usually written in JavaScript which is supported by the most of browsers. The simplest format is as follows.
Example
<zk>
<window id="win">
<button label="change color" onClick='Clients.evalJavaScript("myfunc()")' />
</window>
<script type="text/javascript">
function myfunc() {
$e("${win.uuid}").style.backgroundColor = "blue";
}
</script>
</zk>
Supported events
None | None |
Supported Children
- NONE
Use cases
Version | Description | Example Location |
---|---|---|
5.0+ |
Version History
Version | Date | Content |
---|---|---|
5.0.1 | 04/30/2010 | Initialization |