The head Element
The head
element contains information about the deck. The head
element may contain an access element and/or several meta elements.
The access Element
The access
element is used to limit access to the deck, and must be included within the head section if used. By default, WML decks are public. There may only be one access element in a document. The following table shows the attributes used with the access element.
Attribute | Description |
---|---|
|
The domain of other decks that are able to access cards in the deck. The default value is the domain of the current deck. |
|
The root directory of other decks that are able to access cards in the deck. The default value is the root of the domain, "/". |
The following declaration states that the deck is only accessible from Juicy Studio, and only from the /wmlpages
directory.
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head>
<access domain="juicystudio.com" path="/wmlpages"/>
</head>
<!-- Rest of content here -->
</wml>
The meta Element
The meta
element allows you to provide meta data about the deck. Any number of meta elements may be used in the head of the WML document. The following table shows the attributes that may be used with the meta element.
Attribute | Description |
---|---|
|
This attribute is required, and specifies the meta data for either a http-equiv attribute or the name attribute. |
|
An optional attribute that determines if the property should reach the user agent. The possible values are false, and true. If the value is set to true, it must be sent to the user agent. |
|
Equivalent of HTTP headers. Each meta element must contain either a http-equiv attribute or a name attribute. |
|
Used for meta types that have no HTTP equivalent. Each meta element must contain either a name attribute or a http-equiv attribute. |
The following meta tag instructs the user agent to expire this page from the cache after 1 day (86,400 seconds).
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head>
<meta forua="true" http-equiv="Cache-Control" content="max-age=86400"/>
</head>
<!-- Rest of content here -->
</wml>
Some devices will not refresh the deck if the deck is navigated to with the prev element. The must-revalidate parameter may be used to override this. The following example prevents the page from being cached.
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head>
<meta forua="true" http-equiv="Cache-Control" content="must-revalidate"/>
<meta forua="true" http-equiv="Cache-Control" content="no-cache"/>
</head>
<!-- Rest of content here -->
</wml>
Comments