$Web Browser: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 2: | Line 2: | ||
<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. | <var>$Web_Browser</var> retrieves the version of the requested browser using the ''User-agent'' request header. | ||
==Syntax== | ==Syntax== | ||
<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. | <var>$Web_Browser</var> 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. | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>brand</th> | <tr><th>brand</th> |
Revision as of 22:43, 18 October 2012
<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.