<script>
The <script>
tag can be used within a <web>
element to specify JavaScript code to run when the QuickApp is rendered to a web target such as
a new browser tab, browser window, or iframe.
Description
The <script>
element can either take a url_
attribute
that specifies a link to external JavaScript code or can include a <code
language_="js">
tag that explicitly specifies the JavaScript code to run. For
more information, see <code>
.
Syntax
<dynamic> <render> <web> <script url_="[EXTERNAL_JAVASCRIPT_SCRIPT]"/> </web> </render> </dynamic>
Alternate syntax
<dynamic> <render> <web> <script> <code language_="js"> [JAVASCRIPT_CODE] </code> </script> </web> </render> </dynamic>
Attributes
url_
- Specifies the URL to the JavaScript code to run when the QuickApp is rendered to a web target.
Example
The following example demonstrates how JavaScript code can be included in a
<code>
tag inside a <script>
element. When this
QuickApp is rendered to a web target, the JavaScript code runs and Hello
World! is displayed in a popup box in the browser.
<dynamic> <render> <web> <script> <code language_="js"> window.alert("Hello World!"); </code> </script> </web> </render> <widget class_="text" text_="Hello World Example"/> </dynamic>