scriptBlock - Output Script
Outputs a client script.
Category
Core ControlsSyntax
<xp:scriptBlock attributes>content</xp:scriptBlock>
| Property | Description |
|---|---|
| id | Defaults to scriptBlock1, scriptBlock2,
and so on. |
| value | Specifies the client script. |
| Category | Properties |
|---|---|
| basics | attrs, binding, charset, defer, id, loaded, rendered, rendererType, src, type |
| data | converter, value |
| dojo | dojoArgs, dojoEvent |
| styling | disableTheme, themeId |
Usage
This control applies only to a custom control.At run time, the script executes when the XPage containing the custom control is loaded to the client.
Examples
This Output Script control is in a custom control. It displays analert box when embedded
in an XPage and the XPage is opened.<xp:scriptBlock id="scriptBlock2" type="text/javascript">
<xp:this.value><![CDATA[alert("hello custom")]]></xp:this.value>
</xp:scriptBlock>