A Case for
Browser Emulation
When a web browser or other type of user agent
submits a request for a page from a web server, part of the request from
the browser includes information about itself, including the name of the
agent, its version, etc. (An example of a user agent is Internet
Explorer.) The web server, in most cases, returns a valid web page to
the agent or web browser. By default, HiSoftware products report
themselves to web servers as their respective product names—AccVerify,
AccRepair, or AccMonitor. However, HiSoftware products can emulate other
browsers. If your web server log file is set up to log agents, then you
can see the description of the agents that come to your web site.
Some web developers write web pages with different content for different
web browsers. While the newest Web browsers support this content, the
information must also be accessible to users with older browsers. Below
is an example of some pseudo-code a developer might use in creating a
web page based on this idea.
<%
var browser = Server.CreateObject("MSWC.BrowserType")
ie4 = (browser.version>=4) && (browser.browser=="IE")
ns4 = (browser.version>=4) && (browser.browser=="Netscape")
if (ie4)
{ %> <P>Do something for Internet Explorer 4 and greater <% }
else if (ns4)
{ %> <P>Do something else for Netscape 4 and greater <% }
else
{%> <P>Give this content here for everything else <% }
%>
The above JavaScript code, when used in an Active Server Page (ASP) on a
web server, delivers content to the web browser or agent based on the
identity of the user agent. Depending on the design of the web site and
different options used in writing and delivering the script, this code
above might not be visible to a user viewing the source through a
browser program such as Internet Explorer or Netscape, or even saving
the page locally to test it. Those users might just see the code for
their respective browser.
In testing a web site for accessibility, the user wants to be sure that
the web site is accessible for all web users that might view the page.
Printer Friendly Version...
|