# \<script>

## \<script> <a href="#script" id="script"></a>

The `<script>` element allows the specification of a block of client-side scripting language code, and is analogous to the HTML \<SCRIPT> element.

### Attributes

<table><thead><tr><th width="174.33333333333331">Name</th><th width="157">Data type<select><option value="811ebf03f88f44d1911debb146162058" label="String" color="blue"></option><option value="9d63cfa082474e288f934bd250f0fdb6" label="Integer" color="blue"></option><option value="d05218ef8a7d4639a31efe954db64b1e" label="Boolean" color="blue"></option></select></th><th>Description</th></tr></thead><tbody><tr><td>src</td><td><span data-option="811ebf03f88f44d1911debb146162058">String</span></td><td>The URI specifying the location of the script, if it is external.</td></tr><tr><td>srcexpr</td><td><span data-option="811ebf03f88f44d1911debb146162058">String</span></td><td>Dynamically determine the URI to fetch by evaluating this ECMAScript expression.</td></tr><tr><td>charset</td><td><span data-option="811ebf03f88f44d1911debb146162058">String</span></td><td>(defaults to “UTF-8”) The character encoding of the script designated by src.</td></tr><tr><td>fetchhint</td><td></td><td>This attribute is not supported.</td></tr><tr><td>fetchtimeout</td><td><span data-option="811ebf03f88f44d1911debb146162058">String</span></td><td>(defaults to “fetchtimeout” global property value) The timeout for fetches. Must be specified with the appropriate time units (e.g., “120s” for 120 seconds).</td></tr><tr><td>maxage</td><td><span data-option="811ebf03f88f44d1911debb146162058">String</span></td><td>(defaults to “scriptmaxage” global property value) Tells the platform the maximum acceptable age, in seconds, of cached scripts.</td></tr><tr><td>maxstale</td><td><span data-option="811ebf03f88f44d1911debb146162058">String</span></td><td>(defaults to “scriptmaxstale” global property value) Tells the platform the maximum acceptable staleness, in seconds, of expired cached scripts.</td></tr></tbody></table>

### Notes

It is advisable to place all script text between CDATA delimiters: “\<!\[CDATA\[” and “]]>”. Alternatively, conditional ECMAScript expressions that use the “<” or “>” symbols can use the replacements “\&lt” and “\&gt”, respectively.

### Example

```markup
<?xml version="1.0"?>
<vxml version="2.0">
  <form>
    <script>
      test_var=1234;
    </script>
    <block>
      <prompt>
        The test variable is set to <value expr="test_var"/>.
      </prompt>
    </block>
  </form>
</vxml>
```

The output of the above script would be:

> Computer: The test variable is set to twelve hundred thirty-four.

### Child Tags

None

### Parent Tags

[\<block>](/dev/voicexml/tags/block-tag.md), [\<catch>](/dev/voicexml/tags/catch-tag.md), [\<error>](/dev/voicexml/tags/error-tag.md), [\<filled>](/dev/voicexml/tags/filled-tag.md), [\<foreach>](/dev/voicexml/tags/foreach-tag.md), [\<form>](/dev/voicexml/tags/form-tag.md), [\<help>](/dev/voicexml/tags/help-tag.md), [\<if>](/dev/voicexml/tags/if-tag.md), [\<noinput>](/dev/voicexml/tags/noinput-tag.md), [\<nomatch>](/dev/voicexml/tags/nomatch-tag.md), [\<vxml>](/dev/voicexml/tags/vxml-tag.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.plumvoice.com/dev/voicexml/tags/script-tag.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
