Much like the HTML script
element, this is used to declare a script to be used by the XUL window. You should usually put scripts in a separate file pointed to by the src
attribute, but you may also place the script inline inside the opening and closing script
tags.
More information is available in the XUL tutorial.
Examples
<script src="test.js"/> <script src="http://example.com/js/test.js"/> <script> function foo(){ // code } </script>
Attributes
src
- Type: URI
- The URI of the script.
type
- Type: language content type
- The language of the script. Usually, you would set this to
application/javascript
.
Note: If the JavaScript file is in chrome://, setting this attribute toapplication/javascript
will always use the latest available JavaScript version. If you omit this attribute, the default (and older) JavaScript version is used (like you get when including a JavaScript file from web content without specifying a version number).
Inherited from XUL element |
Properties
Inherited Properties |