Docsity

Browser Capabilities Component in Server-Side Web Programming with Active Server Pages, Slides of Fundamentals of E-Commerce

Partial preview of the text

Download Browser Capabilities Component in Server-Side Web Programming with Active Server Pages and more Slides Fundamentals of E-Commerce in PDF only on Docsity!

Server-Side Web Programming

with Active Server Pages

Browser Capabilities

Component

Browser Capabilities Component

(BCC)

-^

Many reasons for detecting client’s browser capabilities

-^

Client-side Javascript most efficient for simple, obviousqueries (e.g. browser version)

-^

ASP’s BCC more robust for detailed queries like frames,Javascript support, etc.

-^

Most important for support of older browsers that don’tsupport some HTML features, but…

Review - HTTP Fundamentals

•^

Server receives requests from browser/client for resources^ – A

resource

is any chunk of information that can be

identified by a URL like HMTL or image files, scripts,streaming media, etc.

•^

Server retrieves and/or processes the resource

-^

Server sends the resource back to the client

-^

Server logs the transaction

-^

Responses/requests occur using the HTTPprotocol, typically on port 80

Sample HTTP Exchange

To retrieve the resource at

http://www.host.com/path/file.html Browser sends request to host www.host.com, port 80: GET /path/file.html HTTP/1.0From: [email protected]: Mozilla/4.0 (compatible; MSIE 5.0) The server sends a response back to the client: HTTP/1.0 200 OKDate: Fri, 31 Dec 1999 23:59:59 GMTContent-Type: text/htmlContent-Length: 1354[other header information…]Happy New Millenium!(more file contents)

Using the BCC

•^

Keep webserver’s BrowsCap.ini current.^ – Located in \WinNT\System32\inetsrv for IIS4– Updates at

In ASP page, instantiate object & call its

properties:

<% Dim objBCSet objBC = Server.CreateObject(“MSWC.BrowserType”)… Response.write “Table Support: “ & objBC.tables%>

Notes

•^

You can create custom properties in yourBrowsCap.ini file for greater detail.

-^

If you call an undefined property, BCC will returnthe string “Unknown”.

-^

Best coding practices should include closinginstantiated objects after their use:

set

objBC

nothing