Previous ION Script User's Guide: Creating ION Script Applications Next

Specifying URLs

The following ION Script tags have an attribute that takes a URL as its value:

Table 4-1: ION Script Tags That Accept URLs as Values 

Table 4-1: ION Script Tags That Accept URLs as Values 
ION Script Tag
Attribute
Allowable Protocols
<EVENT_DECL>
ACTION
http, https, file, ion
<ION_BODY>
BACKGROUND
http, https, file
<ION_BUTTON TYPE="IMAGE">
SRC
http, https, file
<ION_IMAGE>
SERVER
http, https
<ION_INCLUDE>
SRC
http, https, file, ion

In addition, the following HTML tags have an attribute that can take a URL that points to an ION Script page:

Table 4-2: HTML Tags That Accept URLs as Values 

Table 4-2: HTML Tags That Accept URLs as Values 
HTML Tag
Attribute
Allowable Protocols
<FORM>
ACTION
http, https, file, ion
<FRAME>
SRC
http, https, file, ion
<IFRAME>
SRC
http, https, file, ion

The general syntax for URLs is as follows:

protocol://[username:password@][hostname][:port]/path

protocol must be one of the following:

HTTP URLs

HTTP (Hypertext Transfer Protocol) is the protocol used to transfer HTML files over a network. Cases in which you would use the http:// protocol in your ION Script applications include:

HTTPS URLs

HTTPS (Hypertext Transfer Protocol, Secure) is the protocol used to transfer files over a network using secure transactions. The https:// protocol behaves like the http:// protocol, but is intended to provide secure communication of information such as credit-card numbers.

You need only specify this protocol to take advantage of this security, which the Web server and browser handle for you. If you want to use https://, you can change existing references to http:// in the following three places:

File URLs

File URLs are used to access files on a particular host computer, as opposed to files located on a remote network such as the WWW. The file:// protocol is intended to provide access to text and other files on your Web server, such as when you want to include a file in your ION Script page using the ION_INCLUDE tag.

The syntax for URLs that use the file:// protocol is as follows:

file:///path/filename

If the path is absolute, the leading / must be present, as in the following examples:

UNIX: file:////usr/local/etc/readme.txt

Windows: file:///c|/projects/ionscript/readme.txt


Note
For Windows drives, a vertical line is used in place of the colon when specifying the drive.

ION URLs

The ion:// protocol causes the page referred to in the URL to be parsed by the ION Script parser. When the ion:// protocol is used, the page referred to in the URL will be parsed as an ION Script file no matter what extension the file uses. For example, the following EVENT definition causes the file myfile.xxx to be parsed as an ION Script file:

<EVENT_DECL NAME="event" ACTION="ion:///c:\ion\myfile.xxx"/>  

The only times you specify the ion:// protocol are when you define an EVENT attribute as another ION Script page, and when you include an ION Script file using the SRC attribute of ION_INCLUDE. Note that you cannot use the ion:// protocol in the following ways:

Absolute Paths vs. the ION Search Path

How you specify file:// and ion:// URLs determines whether an absolute path or the ION Search Path is used to locate the file. The ION Search Path is a search path specified in the configuration utility or .ionsrc file (see ION Search Path).

Absolute paths to ion:// and file:// URLs must start with /. For example:

ion:///f:/projects/ionscript/include.ion  

If only a filename is entered, the ION Search Path is used for the path and the leading / may be omitted, For example, if the following URL is used, ION Script will search for include.ion in the ION Search Path:

ion://include.ion  

If only a filename is entered, but you do include the leading /, the absolute search fails and the ION Search Path is used. For example:

ion:///include.ion  

If the entire path is used, and you do not include the leading /, as in the following example, the URL is NOT valid:

ion://f:/projects/ionscript/include.ion  

  IDL Online Help (March 06, 2007)