The Web Folder Behaviors available as of Microsoft® Internet Explorer 5 and later allow users to navigate to a folder view, and include support for Distributed Authoring and Versioning (DAV) and Web Extender Client (WEC) protocols. DAV is a series of extensions to the Hypertext Transfer Protocol (HTTP) and defines how basic file functions such as copy, move, delete, and create folder are performed across HTTP. WEC is a Microsoft® FrontPage® protocol that provides the same sort of functionality as DAV, in addition to its own value-added FrontPage features. Both protocols define how to set and retrieve properties on HTTP resources.
The Web Folder Behaviors enable authors to view sites in a Web folder view, which is similar to the Microsoft® Windows® Explorer folder view. The DAV and WEC protocols add additional capabilities to the Web folder view. For example, using the Web Folder Behaviors and DAV makes it possible to perform the equivalent of a DIR command on an HTTP resource and retrieve all the information necessary to fill a Windows Explorer view. Internet Explorer 5 and later supports two Web Folder Behaviors that allow users to browse sites in a Web folder view.
The anchor and httpFolder Web Folder Behaviors encompass the means to navigate from a Web page to a Web folder view. They provide convenient access to folders and files on an HTTP server. A Web folder view maintains a consistent look and feel between navigating the local file system, a networked drive, and an Internet Web site. Although a Web folder is a part of the file system hierarchy, it does not necessarily represent anything in the file system.
The Web Folder Behaviors provide an easy way to view files and folders on an HTTP server for anyone using Internet Explorer 5 or later. In addition, script authors are empowered with a robust implementation that exposes any HTML object to the Web folder navigation abilities of the Web Folder Behaviors, while delivering to authors the extensibility for designing their own interface. Some of the advantages of using Web Folder Behaviors are:
The anchor behavior is the quickest way to open a Web folder in Internet Explorer 5 and later. This behavior requires a STYLE definition using the anchor behavior, an HTML element, and the FOLDER attribute. If the FOLDER attribute is not set when using the anchor behavior, the HREF attribute on the anchor will be used as normal.
Copy the following code and paste it into a Web page.
<STYLE> A {behavior: url(#default#AnchorClick);} </STYLE> <A HREF = "http://your_server.com/your_directory/your_file.htm" FOLDER = "http://your_server.com/your_directory/" TARGET = "_top" > Open in Web Folder View </A>
The FOLDER attribute specifies the location of the Web folder the anchor will open. Frames and windows can be specified using the TARGET attribute. The anchor behavior requires no additional actions on the part of the author other than adding the behavior in the STYLE element, and adding the FOLDER attribute to the anchor behavior. When using the anchor behavior, keep the following in mind:
Script authors can navigate to a folder view using any object that is participating in the httpFolder behavior. The navigate and navigateFrame methods exposed to the httpFolder behavior provide Web folder view functionality through script. Responsibility for the interface and error handling is presented to the author, providing a means for creative implementation of the behavior and the two methods.
The two methods provide similar functionality. The navigateFrame method allows an author to specify the address and the window or frame to use. This method has the following syntax:
oDAV.navigateFrame(sURL,sTarget)
where:
The following sample implementation opens the arbitrary address "http://www.your_server.com/your_directory/" in Web folder view using the current window.
oDAV.navigateFrame("http://www.your_server.com/your_directory/","_self");
The navigate method is equivalent to navigateFrame(sURL,"_self"), where the sTarget possible value is equal to _self.
Implementing the httpFolder behavior requires a STYLE definition, any HTML object participating in the httpFolder behavior, and script to handle the navigation request. For example:
<!-- The httpFolder class enables the Web Folder behavior. --> <STYLE> .httpFolder {behavior: url(#default#httpFolder);} </STYLE> <!-- The fnOpenFolderView function navigates to Web folder view. --> <SCRIPT> function fnOpenFolderView(){ oDAV.navigateFrame("http://sample.microsoft.com","_self"); } </SCRIPT> <!-- The DIV tag is an arbitrary object --> <DIV ID = "oDAV" CLASS = "httpFolder" /> <!-- The INPUT object calls the fnOpenFolderView function --> <INPUT TYPE = "button" VALUE = "Open Folder View" onclick = "fnOpenFolderView()" >
The following links provide additional information about Dynamic HTML Behaviors.