Search DominoPower's 11,320 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.
WEBMASTER'S TOOLKIT
Dynamically generated JavaScript libraries
By Jeffrey R. Burrows

JavaScript may not have had the media attention that Java has had for the past five years, but it's done more than its glorious namesake to revolutionize Web page design. JavaScript is the glue that holds many Web sites together, especially the user input forms necessary for e-commerce. For Notes developers, its pervasiveness in R5 means an alternative to some of LotusScript's dead-ends and a common development method for Notes and Web clients.

The good news for script developers is that Microsoft's dalliance with VBScript, and its proprietary JScript flavor of JavaScript have given way to a new cross-platform standard called ECMAscript.

The bad news is that different versions of JavaScript proliferate. What's worse, since the interface between script and the browser -- the document object model -- can differ greatly between browsers, developing a Web page that will operate for any browser, or even any recent browser (forgetting Lynx, Cello and Mosaic users), is a real challenge for Web developers.

The challenge
With the growing reliance on JavaScript comes a need to manage the code, cope with browser incompatibilities, protect valuable code from unauthorized copying, and reuse handy functions in other Web pages.

The simplest method of delivering script functions to browsers is to include it in the Web page itself. The HTML tags <SCRIPT> and </SCRIPT> surround the functions, which can then be called in, for example, on click events. This is easy to grasp, but means the whole world can see your code and when you change a function, every Web page with that function must be manually updated. Furthermore, the functions either have to do all the work of adapting to different browsers, or depend on a particular Web browser and model.

Static script libraries
To overcome some of these problems, Netscape Navigator and Internet Explorer (in their 3.x incarnations) introduced the concept of script libraries. Instead of placing the script functions between <SCRIPT> and </SCRIPT> tags on the Web page itself, the code is contained in an entirely separate file, which is loaded by a SRC parameter on the <SCRIPT> tag, like this:

<SCRIPT SRC="../js/validate_library.js"></SCRIPT>

The SRC parameter could refer to a local file on the Web server, as above, or be an absolute URL to a library on another server entirely. For Domino programmers, this URL could refer to a page element (for R5) or a Notes document in a view (for R4) containing script code. The library itself is static, but can be reused in its entirety between Web pages, and centrally updated. Multiple libraries can be used on the same page using multiple <SCRIPT SRC> tags.


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
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Five trends for 2010
DominoPower TV Episode 1: Inside a strategy session with Teamstudio
More about Domino log files
Say goodbye to the Uh-Ohs. Long live the Tens.
Why your log.nsf might not be purging properly
Latest Lotus Headlines
SnTT: XPages Blank Calendar Control (Part 2), adding data
Have your Lotus Notes calendar display multiple time zones
Sample Database for Microsoft Office and Lotus Symphony Integration
Symphony 3.0 beta signals another attack on Office
Enabling DAOS on a database - new recommendation
Need your opinion on some new policy settings for Mail
Sometimes IBM Lotus Domino HTTP RPC Agents aren't the answer...
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad: Apple's latest heartbreaker
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Running auto-respond rules when Outlook is closed
-- Advertisement --

Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.

The many included activities and demos will make you a pro! Expert instructor help is a click away.

Click here to try a FREE demo course!!

-- Advertisement --

Teamstudio announces the 2010 spotlight awards winners!
We had some extraordinary submissions for the 3rd annual Teamstudio Spotlight Awards, and choosing the winners was no easy task for our judges! Click here to find out who won, and to learn more about these remarkable applications and the genius developers behind them!

Tap here for more information.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login