Click to return to the Essentials home page    
Web Workshop  |  Essentials

The Long and the Short of It


Jeff Brown
Rafael M. Muñoz
Microsoft Corporation

September 8, 1997
Updated: September 22, 1997

The following article was originally published in the Site Builder Magazine (now known as MSDN Online Voices) "Web Men Talking" column.

Contents
Express yourself - Embedding custom fonts in Web pages
Standards as a way of life - RSACi ratings
Surfing, a pleasurable experience - Detecting ActiveX components
Who gets what, and when? - Tracking file downloads
Help me - Using HTML Help

The Web Men are inspired. Just as in the days when they were sharpening their pencils and trundling off to school, they're ready to move up a grade. To try something different. A new feature this month, The Web Men in Short, provides quick pointers for site builders needing detailed resources on a wide variety of topics.

Also, the Web Men launch another monthly feature spotlighting the Web site of a different MSDN Online Level 2 member. See The Web Men Linking. And note that The Web Men's Greatest Hits (that's an archive, not a musical CD) has moved to a handy little pop-up window, in which you can review the topics covered in each column.

One more switch: To compensate them for this nifty new stuff, we're letting the Web Men return to a monthly schedule of new columns. For some reason, they insist on actually researching their detailed answers to your toughest queries.

Express yourself

Dear Web Men:

Hi, Web Men!

I am developing a site for our not-for-profit engineering organization at Purdue University. We have a whole bunch of fonts used in our pages that really help to express who we are. The only problem: None of the lab computers have these fonts. My question: Is there a way to embed fonts, or otherwise store them on our server so that anyone visiting our site will be able to get the full experience? Thanks for your help!

Andrew Offenbacher

The Web Men reply:

A group of engineers interested in fonts and self-expression? You folks must not be the stereotypical scientific-calculator-in-hand engineer types!

We're happy to report that what you ask is possible. However, at least for now, only visitors using Microsoft Internet Explorer 4.0 non-MSDN Online link will be able to appreciate your fonts. Internet Explorer 4.0 supports font embedding, which means it can download and use font objects that are linked to your pages. Other browsers don't support this feature at the moment.

The Microsoft Web Embedding Fonts Tool (WEFT) non-MSDN Online link makes it easy to build and use font objects. A preview version is available for download on the Microsoft Typography Web site non-MSDN Online link. WEFT will analyze the fonts used on your pages, and will determine which fonts are candidates for embedding. It can then create font objects, and update your pages with the HTML code needed to embed the font objects. WEFT is very flexible; it even includes a wizard that will step you through this process. The code WEFT adds conforms to the current Web Fonts working draft Non-MS link published by the World Wide Web Consortium (W3C).

Those interested in resources on typography can also peruse the Links and contacts page non-MSDN Online link of the Microsoft Typography Web site. There you will find a zillion links to Web sites with typography-related information. (Well, okay, the number of links is really closer to 300.) Happy typing!

Back to topBack to top

Standards as a way of life

Web-i-llamas:

What code do I need to embed in a page to allow a browser's content advisor (or similar functionality) to screen my pages appropriately? Is there an open standard for this? If not, what, specifically, will work for each browser (primarily the "N" and "E" ones)?

Thanks!

Tom Gideon

The Web Men reply:

Tom, it is becoming really hard to stay up with all the changes occurring on the Internet. What with Java, Dynamic HTML, and the Platform for Internet Content Selection (PICS) rating system, to name just a few, only standards can save us!

When it comes to Internet content and the different rating systems, the best place to keep up with the standards is the W3C Non-MS link site. Information on how to place labels on your Web pages can be found at PICS Label Distribution Label Syntax and Communication Protocols  Non-MS link.

Be sure to check each browser's home site for specific information on how that particular browser is handling the rating-systems issue. For instance, Microsoft Internet Explorer has adapted the Recreational Software Advisory Council's (RSAC) computer-game rating system for use on the Internet, referred to as RSACi (the "i" stands for "Internet"). For more information, read Explanation of the PICS Rating System in Internet Explorer 3.0 Non-MSDN Online link.

Content and profiling information on individuals is becoming a very important Internet issue; a lot of major companies are seeing the benefits that standards provide. One example is the set of content-rating standards. Another is the proposed Open Profiling Standard (OPS) which will be used to create a trusted exchange of information between individuals and Web sites. This standard is being supported by such companies as Microsoft, Netscape, and FireflyNon-MSDN Online link

Back to topBack to top

Surfing, a pleasurable experience

Dear Web Men:

Okay, I want a cool site that uses Macromedia Flash like MSN on the home page. However, I don't want to scare away anyone who is not willing to wait for the 170K ActiveX™ component to download. Even though Netscape plug-ins are annoying to download and install, I can test for their existence before hand using JavaScript and provide alternate content if they don't have it.

How does one test if a user has an ActiveX component to provide alternative content?

I really think EMBED and OBJECT should have a REQUIRED="FALSE" parameter that shows the <NOEMBED> or <NOOBJECT> content. This would allow Web builders the option of showing alternative content and provide surfers the option of whether to download or not.

Patrick Meyer

The Web Men reply:

Patrick, that's a great idea -- checking for components and plug-ins, and providing the user an alternate way to view your site. More and more people, such as yourself, are working hard to make the Internet a pleasurable experience for the casual surfer.

Checking for ActiveX components can be done with the help of Visual Basic® Scripting Edition (VBScript), and is relatively easy.

Note: You will need to upgrade to VBScript version 2  Non-MSDN Online link for this to work correctly. It is always good to stay up with the latest script versions, anyhow.
You will notice that we have used Active Server Pages (ASP) technology, so that we can also check whether the current browser even has the technical capabilities that we are concerned with -- in this case VBScript and ActiveX.
<%
   Set objBrowserType = Server.CreateObject
("MSWC.BrowserType") If objBrowserType.vbscript = True And
objBrowserType.ActiveXControls Then %> . This is where the VBScript will eventually go. . <Else%> <H2 align=center>This browser doesn't
support VBScript or ActiveX controls. You should head off to an appropriate page
to handle this situation.</H2> <%End If%>

In this example, we are checking for the existence of the Microsoft Agent control. In our VBScript, which we will place in the middle, we first call our HaveAgent() function. If the component doesn't exist, we change the location.href to point to another URL, which is where we will provide our alternative content. In our example, we direct the browser to the Microsoft Agent home site.

If Not HaveAgent() Then
'Microsoft Agent control was not found.
   location.href="http://www.microsoft.com/workshop/
prog/agent/default.htm"

The HaveAgent function uses the CreateObject() function to create the component object for which we are checking. We then call the IsObject() function to test the results of CreateObject(), and this is what is returned and used in the above If statement.

Function HaveAgent()
   ' This procedure attempts to create an Agent Control
object. ' If it succeeds, it returns True. ' This means the control is available on the client. ' If it fails, it returns False. ' This means the control hasn't been installed
on the client. ' Note that the name "Agent.Control.1" is specific
to version 1 ' of the Agent Control. Dim agent HaveAgent = False On Error Resume Next Set agent = CreateObject("Agent.Control.1") HaveAgent = IsObject(agent) End Function

View the complete ActiveXCheck code. Here you can lovingly lift the entire code and add it to your own HTML page.

Back to topBack to top

Who gets what, and when?

Dear Web Men:

I have a Web page with seven files that are available for download. It is presently an HTM file. But I would like to be able to capture information about what files are downloaded by a visitor and when. Is there a way to capture the click event on the hyperlink to the file, and write it out to a file? I think this should be run on the server, but the few things I try don't seem to work. Looking forward to your wisdom and reply to shed light on this problem.

Laurie Kern

The Web Men reply:

You're right, Laurie: This is something that should run on the server. You could change your links so that they would run a server-side script. You could pass the name of the file to be downloaded as part of the URL for the script. The script could then do whatever you wanted, like write some data about the user's request to a file on the server, and then send back the requested file.

But you don't need to do all this work yourself. Really! Your Web server should be able to capture all this information for you in its log files. Just be sure logging is enabled on your server, and go back through the logs to find out who is downloading what, and when.

Here is part of a log file generated by Microsoft Internet Information Server (IIS) Non-MSDN Online link:

157.56.106.113, -, 9/2/97, 10:25:03, 
W3SVC, SERVER1, 157.56.106.113, 203, 390, 362, 200, 0, 
GET, /development/downloads.htm, -, 
157.56.106.113, -, 9/2/97, 10:25:05, 
W3SVC, SERVER1, 157.56.106.113, 2078, 439, 235, 200, 0, 
GET, /development/file1.xyz, -, 
157.56.106.113, -, 9/2/97, 10:25:10, 
W3SVC, SERVER1, 157.56.106.113, 4375, 439, 235, 200, 0, 
GET, /development/file2.xyz, -,

As you can see in the highlighted text above, IIS records the user (IP address), date and time of the request, and any files the user requested. This data can be hard to sort through in its raw form, so you will definitely want to try out some log file analysis tools.

If you are using IIS, try the Usage Analyst included in Microsoft Site Server, Enterprise Edition Non-MSDN Online link. A trial version of Site Server can be downloaded or ordered from the Download and Trial Center Non-MSDN Online link on BackOffice Live. For more information on logging with IIS, refer to Chapter 7 (Logging Server Activity) of the IIS product documentation.

If you are using another Web server, then you may want to check out what is available in the Logging Accesses and Statistics category Non-MS link of The CGI Resource Index.

Back to topBack to top

Help me

Dear Web Men:

I am trying to create a documentation system for an IS department using the control provided by Microsoft called HHCTRL, and I am having two problems.

I have created a frameset; the left contains the control, and I want to be able to display the contents of the document on the right side of the frameset.

  1. I do not know how to define the document that will be displayed on the right side of the frameset inside of the toc.htm file.
  2. I do not know how to make it display on the right side of the frame.

Rosa E. Orozco

The Web Men reply:

Hola, Rosa, como esta? So you are looking for some help, eh? No pun intended! Okay, maybe just a little pun. The control you are referring to above, HHCTRL, is the Microsoft HTML Help, which is still pretty hot off the press.

To answer your questions: When in doubt, use your help files. Yes, that's right; we started browsing through the help of Microsoft HTML Help, and we found all the answers we needed. The help files were pretty good -- and the search feature came up with many references for our search criteria.

In your case, Rosa, you want to search for "using framesets," which will produce the search topic "About HTML framesets." If you walk through this description of HTML framesets, you'll come upon a step-by-step, easy-to-follow example of how to Create a frameset that uses the HTML Help control.

In the initial discussion of this example, you will see that you need a table of contents (TOC) file, which you can make with the HTML Help Workshop application, and a few topic files (.HTM or .HTML) to which the TOC file links. This answers your first question, and the example provides links on how to create each of these files with the Workshop application.

After you have created a TOC file, assign each section to a corresponding HTML page, which will contain the information for each section of your TOC. To set this up, use the Insert a heading and Insert a page buttons.

In step 3, "Adding a default frame location to the table of contents file," you need to use the Contents properties button. This button is in the upper right-hand corner of the TOC window, and it will bring up the Table of Contents Properties dialog. Select the General tab. You will see a text box labeled Default frame: that contains the name of the HTML page in which you want to display your content; in your case, the Default frame: text box will display the name of the right-hand frame of your frameset.

We have given you a quick and brief outline of how to accomplish what you need, Rosa. We'll leave the specific details to you. The fun of having a new application is just playing around with it!

Jeff Brown, when not forcing family and friends to listen to Zydeco and country blues music, helps develop Microsoft Mastering Series titles -- with a smile.

Rafael M. Munoz is a part-time Adonis, and full-time support engineer for Microsoft Technical Support. He takes it very, very personally every time you flame Microsoft.


The Web Men in Short
Added September 22, 1997

Q: Nelson Emilio asks how to use Active Server Pages to show first-time visitors a special "first-time" page?

A: Use cookies. Check our archived question Bake a batch about cookies and using them with Active Server Pages.

Q: Issac Mao uses the Microsoft Layout Control. He can't see the controls he has created with Internet Explorer 4.0 Preview 2.

A: The HTML Layout Control technology, originally released with Internet Explorer 3.0 Non-MSDN Online link, is now natively supported by Internet Explorer 4.0 Non-MSDN Online link. Refer to the HTML Layout Control site for further usage information.

Q: Irene Sakellarakis needs to set up an intranet using Windows NT Server. How to get started?

A: Check the Intranet Solutions Center Non-MSDN Online link for resources, and the Microsoft Intranet Solutions Base Non-MSDN Online link to evaluate Microsoft products for supporting intranets.

Q: Mona Ellis wants to start using DHTML and style sheets. Where can she find examples of style sheets?

A: Look in the MSDN Online Web Workshop's DHTML, HTML & CSS area and the Tools & Samples area.

Posted September 8, 1997

Q: Rob Ramano, a C++ programmer, wants to program with Java and HTML. Where to start?

A: See Introduction to Java for the C++ Developer, by Nancy Cluts; Microsoft technologies for Java site Non-MSDN Online link; Developer.com's Gamelan Java Directory Non-MS link.

Q: Rick Little noticed a funny URL, ".../feedback.dll?suj=4," and asks how the value "suj=4" is passed into a .DLL.

A: This calls an ISAPI application, a special type of DLL on Microsoft Internet Information Server. See the ISAPI documentation.

Q: Justin Young asks how servers connect to the Internet.

A: Check Mary Haggard's second For Starters column, Get Your Server Here!

Q: Sergey Nikitin seeks resources on security features and encrypted Web pages.

A: Check out the Microsoft Security Advisor site and the MSDN Online Web Workshop's Security area of the MSDN Online Web Workshop.

The Web Men's Greatest Hits

List of Web Men Topics

Write us!



Back to topBack to top

Did you find this article useful? Gripes? Compliments? Suggestions for other articles? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.