Search DominoPower's 11,441 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
Dynamically generated JavaScript libraries (continued)

Writing the script library dynamically also offers other opportunities:

  • You can send compressed code to the browser, with all comment lines and extraneous white space removed. This means that code can be well documented with no performance loss. This will maximize its comprehensibility to developers, and minimize it for curious surfers.
  • You can manage beta cycles more easily. Beta (or alpha) code can be stored in the library, and included in libraries only when a set parameter is passed to the Web agent.
  • Usage of code could be recorded, for statistical and/or billing purposes, and
  • Dynamically created JavaScript can be written inside the library.

Dynamic JavaScript inside dynamic libraries can be illustrated by the classic problem of browser detection. When the Domino server is creating the library, it knows what model of browser is being used, and exactly what that browser is capable of. Hence, a dynamic scripter could generate on-the-fly functions such as those that follow, which are already adapted to the client browser. First, here's an example of code returned to a Netscape Navigator 3.01 browser:

var is_xml = false;
var is_desc = 'Netscape Navigator 3.01';

function setanybackground(obj,color)
var targetObj=getObject(obj)
targetObj.bgColor=color }

The next example shows code returned to an Internet Explorer 5 browser:

var is_xml = true;
var is_desc = 'Internet Explorer 5';

function setanybackground(obj,color)
var targetObj=getObject(obj)
targetObj.backgroundColor=color }

These functions and variables are then available, just like human-created ones, for use by other scripts or HTML events on the Web page requesting the library. They will work perfectly for that page but are of no use to other developers -- they are also as small and fast as JavaScript functions can possibly be.

Since the scripts and sites are held as Notes documents, you could enable powerful version control procedures by building around them all the approval mechanisms and workflow that is standard fare for Notes developers. Add in to that the unbeatable power of Notes replication, and you can maintain multiple Web sites easily and securely, even from a dial-up portable.

Do it today
To get you started on the concept, a fully working dynamic JavaScript generation system is ready for download and use now. It's called Domino Active Script Library, it's completely free to use and copy and can be found at http://www.rhizomatics.demon.co.uk/software/.

This library implements much of the potential described above, including auto detection of browsers, dynamic JavaScript code, the Netscape standard client sniffer variables, alpha and beta testing, browser and script language dependent scripts, code compression, and script security.

Packages of functions are contained in Script documents. Site documents describe the functions required by individual Web pages. Browser documents describe which browsers can handle which level of JavaScript. It's written for R4.6 and up. There is also support for storing LotusScript in the library.


« Previous  ·  1  ·  2  ·  3  ·  4  ·  Next »
Other articles you might like
Home > Internet Technologies > JavaScript (13 articles)
   Sorting your Domino views with JavaScript
   Give your Domino views life with DHTML
   Using dynamically generated HTML to thwart spam email address harvesting
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- Advertisement --

Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done. Native to Lotus Domino. The User Experience unseen for Lotus Domino. Do more with less. Really.

See the possibilities Docova unleashes for Lotus Domino.
-- Advertisement --

Integrate your Notes Applications with Microsoft Office and Symphony
Integra for Notes Integrates Microsoft Office and/or IBM Lotus Symphony
Requires NO change to the design of the appliation or Installations of DLL's and EXE's
  • Integra is a ready to use solution, enhance static reports with Excel data analysis, pivot tables, macros
  • User friendly aproach, using a point and click access to features
  • Reports from any Lotus Notes databases
  • Runs reports through a Notes client, web browser and scheduled basis
  • Allows use of LotusScript for advanced data manipulation
  • Enables self service reporting capabilities to end-users


Learn more at www.integra4notes.com.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login