$Web Browser: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
mNo edit summary |
||
Line 3: | Line 3: | ||
<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" /> % | <p class="syntax"><section begin="syntax" />%vsn = $Web_Browser( brand ) | ||
<section end="syntax" /></p> | <section end="syntax" /></p> | ||
<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™</td></tr> | |||
<tr><th><var>NS</var></th> | |||
<td>Netscape Navigator™</td></tr> | |||
<tr><th><var>OPERA</var></th> | |||
<td>Opera™ | |||
</td></tr></table> | </td></tr></table> | ||
</td></tr></table> | </td></tr></table> | ||
This function is useful for testing browser type and release: | ==Examples== | ||
<p class="code"> | 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> | ||
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> | ||
[[Category:Janus Web Server $functions|$Web_Browser]] | [[Category:Janus Web Server $functions|$Web_Browser]] |
Revision as of 23:03, 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" />
%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
|
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