ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Script Zk


Enviado por   •  24 de Noviembre de 2013  •  296 Palabras (2 Páginas)  •  312 Visitas

Página 1 de 2

Script

Demonstration: Script

Java API: Script

JavaScript API: Script

Style Guide: N/A

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.

Alternatives

Instead of using the script component, you could use the script directive instead. It does not support defer, but it is more efficient since no component is created.

<?script src="~./js/zk.debug.wpd"?>

<?script content="jq.IE6_ALPHAFIX='.png';"?>

where the first statement loads the debug utility and the second generates JavaScript code snippet directly.

Another alternative is HTML SCRIPT. For example, we could define global variables and functions as follows

<n:script xmlns:n="native"><!-- use the native namespace -->

var a_global_variable;

function a_global_function () {

alert("native script");

}

alert("you can not access this as widget but evaluated immediately");

</n:script>

Example

ZKComRef Script Example.png

<zk>

<window id="win">

<button label="change color" onClick='Clients.evalJavaScript("myfunc()")' />

</window>

<script type="text/javascript">

function myfunc() {

jq("$win").css("backgroundColor", "blue");

}

</script>

</zk>

Defer the Evaluation

By default, the specified JavaScript code will be evaluated as soon as the page is loaded. There is an attribute called defer. By specifying true, the JavaScript code

...

Descargar como (para miembros actualizados)  txt (2 Kb)  
Leer 1 página más »
Disponible sólo en Clubensayos.com