$Web Browser: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 1: Line 1:
{{DISPLAYTITLE:$Web_Browser}}
{{DISPLAYTITLE:$Web_Browser}}
<span class="pageSubtitle"><section begin="desc" />Retrieve browser version<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Retrieve browser version<section end="desc" /></span>


$Web_Browser retrieves the version of the requested browser using the ''User-agent'' request header.
$Web_Browser retrieves the version of the requested browser using the ''User-agent'' request header.
Line 8: Line 6:
<p class="syntax"><section begin="syntax" /> %VSN = $Web_Browser( brand )
<p class="syntax"><section begin="syntax" /> %VSN = $Web_Browser( brand )
<section end="syntax" /></p>
<section end="syntax" /></p>


$Web_Browser accepts one required argument and returns a number containing the version of the indicated browser or 0 if the browser is not of the indicated type.
$Web_Browser accepts one required argument and returns a number containing the version of the indicated browser or 0 if the browser is not of the indicated type.
Line 16: Line 13:
</td></tr></table>
</td></tr></table>


Returns the release of specified browser or 0 if not that browser. Valid browsers are


Returns the release of specified browser or 0 if not that browser. Valid browsers are
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>IE</th>
<tr><th>IE</th>

Revision as of 20:19, 22 February 2011

<section begin="desc" />Retrieve browser version<section end="desc" />

$Web_Browser retrieves the version of the requested browser using the User-agent request header.

Syntax

<section begin="syntax" /> %VSN = $Web_Browser( brand ) <section end="syntax" />

$Web_Browser accepts one required argument and returns a number containing the version of the indicated browser or 0 if the browser is not of the indicated type.

brand The type of browser for which version is to be checked.

Returns the release of specified browser or 0 if not that browser. Valid browsers are

IE for Microsoft Internet Explorer&TRADEMARK.,
NS for Netscape Navigator&TRADEMARK.
OPERA for, you guessed it, Opera&TRADEMARK..

This function is useful for testing browser type and release:

IF $Web_Browser('IE') THEN

for example, is useful for testing if the browser is any release of Internet Explorer and a

IF $Web_Browser('NS') GE 6 THEN

is useful for testing if the browser is a Netscape Navigator release 6 or later.