Introductory steps for ASP Programming (14): Browser & Linkin

Source: Internet
Author: User
First, Browser capabilities components
The main function of this component is to extract the version information that identifies the client browser.
The rationale is this: When a client browser sends a page request to the server, it automatically sends a user Agent HTTP header, which is an ASCII string that declares the browser and its version. The browser Capabilities component maps the user agent to the browser indicated in the file Browscap.ini and identifies the client browser through the BrowserType object's properties.
If the object does not find an entry in the Browscap.ini file that matches the title, the default browser properties are used. If the object does not find a match and the default browser setting is not specified in the Browscap.ini file, it sets each property to the string "UNKNOWN".
By default, browscap.ini files are stored in windowssysteminersrv (if 95/98+pws4) or ntsystem32inersrv (if NT) directories, you can edit this text file yourself, To add your own properties or modify the file according to the latest published browser version of the update file.
It can be concluded that the Browser capabilities component is to extract the contents of a file and then compare the display. How to apply it exactly?
1,btinfo.asp
<%set Bc=server. CreateObject ("Mswc.browsertype")%> browser name is browser:<%=bc.browser%><br> browser version is version:<%= Bc.version%> <br> Browser main version is majorver:<%=bc.majorver%> <br> Browser auxiliary version is minorver:<%=bc.minorver% > <br> Browser's operating platform is platform:<%=bc.platform%> <br>
Apparently "<%set Bc=server. CreateObject ("Mswc.browsertype")%> is the creation of a browser component
The following, such as "Bc.browser", is a specific feature of the display browser.
2,btif.asp
<%set Bc=server. CreateObject ("Mswc.browsertype")%> <%if bc.frames=true then%> Browser supports multiple window (frames) display <%else%> browsers do not support multiple windows ( Frames) shows <%end if%> <br> <%if bc.backgroundsounds=true then%> browsers can play background music (backgroundsounds) <% Else%> Browser cannot play background music (backgroundsounds) <%end if%> <br><%if bc.tables=true then%> Browser support table (tables) display <%else%> browsers do not support tables (tables) to display <%end if%> <br> <%if bc.beta=true then%> Your browser is a beta beta <%else %> your browser is an official version of <%end if%> <br> <%if bc.activexcotrols=true then the%> browser support active control <%else%> Browser Active control <%end if%> <br> <%if bc.cookies=true then%> browser support cookie feature <%else%> browser does not support cookies function < %end if%> <br> <%if bc.vbscript=true then%> browsers support VBScript <%else%> browsers do not support VBScript <%end If%> & lt;br> <%if bc.jscript=true then%> browsers support JScript <%else%> browsers do not support JScript <%end if%>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.