The script Component

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.

<script type="text/javascript">
function myfunc() {
    $e("${win.uuid}").style.backgroundColor = "blue";    
}
</script>

As shown above, you can use EL expressions (${win.uuid}) in script codes.

Of course, you can reference to an external JavaScript file with the src property as follows.

<script src="/js/super.js" type="text/javascript"/>

With ZK, developers rarely need to specify JavaScript codes to execute, since the ZK applications are running at the server (and execute in your favorite language). They are usually to customize the behavior of ZK Client Engine, or to run the legacy JavaScript libraries.