|
To access the contents, click the chapter and section titles.
HTML 4.0 Sourcebook
About URLsAbout URLs reference general information about the browser. This URL format was invented by Netscape as a tool for displaying information about the browser and also for presenting personal information about the browser developers. For example, the URL about:mozilla references (only on Netscape Navigator) a brief page that reflects the youthful enthusiasm of the Netscape developers (just try it!), while the URLs about:marca and about:ebina provide information about Marc Andreessen and Eric Bina, two of the co-founders of Netscape Inc. Needless to say, these three URLs do not work on Internet Explorer! There are, however, four about URLs with practical uses. These are:
Javascript URLsJavascript URLs encode JavaScript program code within a URL. The general form is javascript: javascript-statements where javascript-statements is a semicolon-separated list of valid JavaScript statements. This URL can, on Netscape Navigator and Internet Explorer 4 (but not Internet Explorer 3), be typed directly into the Open File or Location window, thereby providing an easy way to test simple JavaScript expressions. For example, typing the URL javascript:alert('Hi Mom!') into the browsers Location window will tell the browser to pop up a JavaScript alert window with the associated text. With Netscape Navigator, the special URL javascript:that is, a javascript URL without any JavaScript statementscauses the browser to display a special JavaScript type-in field at the bottom of the browser window. This is useful for testing small pieces of JavaScript code. The results of running the typed-in JavaScript commands are displayed in the portion of the browser window above the type-in field. Javascript URLs can be used, within a hypertext anchor, to invoke a JavaScript program when the hypertext link is accessed. Example markup is: <A HREF=javascript:anchor_handler()>anchored text</a> where the function anchor_handler() is a JavaScript function to run when the link is accessed. Similarly, the SRC element of an IMG element can take a javascript URL value, but note that the script must then pass an image to the IMG element object so that the element has something to display. Of course, using javascript URLs in these contexts means that the documents will be improperly renderedor will not function at allif JavaScript is disabled or is not supported by the browser. A more reasonable approach is to use the onClick (or other) event-handling attributes for the A and IMG elements, as discussed in Chapter 7.
Mailbox URLs (Netscape Navigator 4 Only)Mailbox URLs reference the local mail client on the browser. With Netscape Navigator 4, a mailbox URL causes the browser to launch the mail client (usually Netscape Messenger) and open the mailbox defined in the body of the URL. For example, the URL mailbox:inbox will open the folder named Inbox, which, with Netscape Messenger, is the default name for the folder containing incoming, unread mail. If no folder is specified (i.e., mailbox:), then the mail client is launched, and the user must choose a mailbox to open. If the URL specifies a mailbox that does not exist, then the mail client is not launched. Netscape Navigator 4 also uses mailbox URLs to display, on the Navigator browser, resources that are referenced within mail or newsgroup messages via cid or mid URLs. Res URLs (Internet Explorer 4 Only)Res URLs reference a resource that can be retrieved from a software module, or DLL (Dynamic Load Library), accessible to the browser. The general form is: res:// resource-file/res-type/res-id where resource-file/ is the path to and name of the file containing the module, res-type/ is an optional string that defines the resource type, and res-id is the specific identifier for the resource within the module. An example is: res://mymodule.dll/doc23.html The use of res URLs requires a detailed understanding of the Active-X model for data storage within DLLs. For those interested, this information is available at the Microsoft Web site, at: View-Source URLs (Netscape Navigator 4 Only)View-source URLs cause a Netscape browser to render a source listing of the referenced resource. The value for the view-source URL must be the URL of the resource to be displayed, for example: view-source:<http://www.utoronto.ca/home.html> View-source URLs are used internally by the Netscape Navigator software to generate source listings and should not be used in HTML documents. Wysiwyg URLs (Netscape Navigator 4 Only)Wysiwyg URLs are used internally by Netscape Navigators JavaScript engine and denote certain cases where JavaScript code produces the document content being displayed by the browser. Authors should never themselves code (or need to code) wysiwyg URLsbut it is always nice to know where they came from! Coming AttractionsSeveral other special-purpose URL schemes have recently been defined and are being deployed in a variety of applications. For example, the imap scheme designates IMAP mail servers, mailboxes, messages, and search programs on Internet hosts, and is used to locate mail messages on IMAP servers. This serves as a useful complement to the cid and mid URLs.
|
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement. |