Script

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.

<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>

Class Name

org.zkoss.zul.Script

Supported Child Components

*NONE

Supported Events

*NONE

Properties

Property

Description

Data Type

charset

Sets whether the button (on the right of the textbox) is visible.

java.lang.String

content

Sets the content of the script element.

java.lang.String

defer

Sets whether to defer the execution of the script codes.

boolean

src

Sets the URI of the source that contains the script codes.

java.lang.String

type

Sets the type of this client script.

java.lang.String

Methods

Name

Description

Return Data Type

isChildable()

Not childable.

Value: false

boolean

redraw(java.io.Writer out)

Inherited From