$Web Browser: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
(Automatically generated page update)
 
(3 intermediate revisions by 3 users not shown)
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">Retrieve browser version</span>


<var>$Web_Browser</var> 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"><span class="term">%vsn</span> = <span class="literal">$Web_Browser</span>( <span class="term">brand</span> )
<section end="syntax" /></p>
</p>
 


<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>%vsn</th>
<td>A number containing the version of the indicated browser, or 0 if the browser is not of the indicated type.
<tr><th>brand</th>
<tr><th>brand</th>
<td>The type of browser for which version is to be checked.
<td>The type of browser for which version is to be checked. Valid browsers are
<table class="syntaxTable">
<tr><th><var>IE</var></th>
<td>Microsoft Internet Explorer&trade;</td></tr>
<tr><th><var>NS</var></th>
<td>Netscape Navigator&trade;</td></tr>
<tr><th><var>OPERA</var></th>
<td>Opera&trade;
</td></tr></table>
</td></tr></table>
Returns the release of specified browser or 0 if not that browser. Valid browsers are
<table class="syntaxTable">
<tr><th>IE</th>
<td>for Microsoft Internet Explorer&TRADEMARK.,</td></tr>
<tr><th>NS</th>
<td>for Netscape Navigator&TRADEMARK.</td></tr>
<tr><th>OPERA</th>
<td>for, you guessed it, Opera&TRADEMARK..
</td></tr></table>
</td></tr></table>


This function is useful for testing browser type and release:
==Examples==
<p class="code"> IF $Web_Browser('IE') THEN
This function is useful for testing browser type and release.
For example, the following tests if the browser is any release of Internet Explorer:
<p class="code">If $Web_Browser('IE') Then
</p>
</p>


for example, is useful for testing if the browser is any release of Internet Explorer and a
And the following tests if the browser is Netscape Navigator release 6 or later:
<p class="code"> IF $Web_Browser('NS') GE 6 THEN
<p class="code"> IF $Web_Browser('NS') GE 6 THEN
</p>
</p>
is useful for testing if the browser is a Netscape Navigator release 6 or later.


[[Category:Janus Web Server $functions|$Web_Browser]]
[[Category:Janus Web Server $functions|$Web_Browser]]

Latest revision as of 00:43, 16 April 2013

Retrieve browser version

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

Syntax

%vsn = $Web_Browser( brand )


%vsn 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. Valid browsers are
IE Microsoft Internet Explorer™
NS Netscape Navigator™
OPERA Opera™

Examples

This function is useful for testing browser type and release. For example, the following tests if the browser is any release of Internet Explorer:

If $Web_Browser('IE') Then

And the following tests if the browser is Netscape Navigator release 6 or later:

IF $Web_Browser('NS') GE 6 THEN