★ wanayoo — archive 1999 http://developer.iplanet.com/docs/examples/javascript/webwidget/doc.htmlNouvelle recherche | Portail wanayoo
iPlanet

You are here:  Home > Developers > Sample Code > JavaScript > JavaScript Sample Code
JavaScript Sample Code
 iPlanet Developers


Developer Program
  Membership
  One-to-One Support
  Newsgroups
  Member Services

Developer Publications
  View Source
  Developer News

Documentation
  Technical Manuals
  White Papers
  TechNotes
  Sample Code
  FAQs
  Books

Technologies
  CSS
  DOM
  CORBA
  Directory & LDAP
  Dynamic HTML
  Java
  JavaScript
  Linux
  RDF
  Security
  SSJS
  XML
  XUL

Developer Downloads
  Tools & SDKs
  Patches

iPlanet Products
  Technical Resources










spacer
Webtop Widget

INTRODUCTION

The Webtop Widget is a sample JavaScript component that opens a "Webtop" from Navigator 4.0 or higher.

You can specify your own HTTP URL for the Webtop via the following HTML Form:

Note: submitting this form will open the webtop, which must be prefixed with "http://". To close the webtop, click on it and press Ctrl+W or Alt+F4, depending on your platform hot-keys.

You can also use this digitally signed script with un-signed web pages by adding the script to your web page, like this:

<SCRIPT LANGUAGE="JavaScript1.2" SRC="/old?u=http%3A%2F%2Fdeveloper.iplanet.com%2Fdocs%2Fexamples%2Fjavascript%2Fwebwidget%2Fwebtop.js&y=1999" ARCHIVE="webtop.jar">

Then call your page with the URL of your webtop attached as a query string, something like this:

http://www.yourdomain.com/yourpage.html?http://www.yourdomain.com/yourwebtop.html

This will open the webtop containing your query string URL.

HOW IT WORKS

Contained within the webtop.jar archive is a JavaScript library file entitled webtop.js. The code in this library contains the following function:


function openWebtop() {
    var url = location.search.substring(1,location.search.length);
    netscape.security.PrivilegeManager.enablePrivilege('CanvasAccess'); 
    window.webtopWin = window.open(url || "http://developer.netscape.com", 'webtop', 'alwaysLowered=yes,outerWidth='+ screen.availWidth +',outerHeight='+ screen.availHeight +',left='+ screen.availLeft +',top='+ screen.availTop +',titlebar=no');
}

The openWebtop() function is a part of this digitally signed script, which requests the "CanvasAccess" privilege via the netscape.security.PrivilegeManager to display the Webtop.

Webtops use this customizable "Canvas" mode to display a chrome-less "unframed" window, which is without a titlebar, menubar, statusbar or scrollbars, and can cover the entire desktop and be locked to the back-most layer of the display.

That's the idea in Webtops and Canvas mode, such that developers can display windows in a different way without the normal native window features, for various reasons, such as for building your own menubar or scrollbars that are unique and/or cross-platform.

Check out Visual DHTML, which illustrates examples of customized scrollbars, menubars, toolbars, statusbar, etc. in DHTML.

SCROLLBARS

If you're not interested in customized scrollbars, then host your webtop page inside a frameset, and the frames-based scrollbars will work for scrolling your webtop. For example, I created a page with a simple frameset that allows you to specify your own URL for the main content frame. You can access this frameset with your URL from the following form:

Scrollbars will appear for pages that need them via the frameset.

MORE EXAMPLES

The Webtop Widget is free to the public, and you can submit your URL for possible posting here, if you use the Webtop Widget on your page, such as the following sites have done:

DOWNLOAD

You should have no problems running your webtop from this page on-line; however, for off-line usage you can download the following ZIP archive which contains the webtop.jar:

webtop.zip


Related Reading


Any sample code included above is provided for your use on an "AS IS" basis, under the Netscape License Agreement - Terms of Use

spacer spacer


                                                       
iPlanet International | Year 2000 | Site Map | Feedback
Products | Solutions | Support | Services | Download | About Us | Developer
© 2000 Sun-Netscape Alliance. All Rights Reserved  Privacy Policy