1.4

enter the value (for a name-type meta tag) or the content (for a . For more information on
<meta> tags, see W3Schools - HTML meta tag.
Adding information to the <head> via script
When generating Web output, the Designer automatically adds the included resources to the
<head>. To add other tags to the <head>, such as a <base> tag to set a default base
URL/target for all relative URLs in a document, you need to write a script. If you are not familiar
with scripts, see "Write your own scripts" on page 376 for an explanation of how scripts work.
1.
Create a script: on the Scripts pane at the bottom left, click New. A new script appears in
the list. Double-click on it to open it.
2. Change the name of the script, so that it reflects what the script does.
3.
Choose the option Selector and in the Selector field, type head.
4. Write a script that appends an element to the <head> of the web page.
Example
The following script adds a <base> element to the head of a web page.
results.append("<base href='http://www.w3schools.com/images/'
target='_blank'>");
Using JavaScript
JavaScript files, libraries and frameworks can be added to a template, primarily for use in Web
pages and Capture OnTheGo Forms. Before doing this, you need to choose which kind of
library or framework you want to work with, depending on the type of features you really desire.
For a bit of help with that and a few examples, see this how-to: Using external libraries.
Adding JavaScript files to the resources
To add a JavaScript file to the resources:
l
Right-click the Javascript folder on the Resources pane, and click New Javascript.
Double-click it to open and edit it.
l Alternatively, drag and drop the JavaScript file from the Windows Explorer to the
JavaScript folder on the Resources pane.
Next, include it in a Web page; see below.
Page 450