Search DominoPower's 11,443 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)

Libraries are the first step to organizing and protecting code. The casually curious user who views the source of a Web page will see only the <SCRIPT SRC> tag at the top of the page. If she cared and was sufficiently technically competent, it's possible to type the URL from the <SCRIPT> tag directly into the browser address bar and retrieve the code. Or more creative yet, if you have a useful library of script, an unscrupulous developer could load it from your site every time a browser loads the page -- both stealing your code and keeping your server busy!

Dynamic script libraries
This article proposes a way of going beyond the current script library concept, taking advantage of the database-driven nature of Lotus Domino servers. Summed up, the principle is: "Why have static when you can have dynamic?"

Here is how dynamic script libraries would work:

  • The browser calls a Domino Web agent rather than a static page address using the SRC parameter of its <SCRIPT> tag.
  • This Web agent first determines which browser is being used, and what the capabilities of that browser are (e.g. frames, XML, JavaScript 1.3, JScript 1.1, etc.)
  • The Web agent next determines the URL of the Web page asking for the script library.
  • Next, it checks in its database for that URL, and, if finding it, gets a list of required script packages.
  • Then, it searches its database for the script packages that best match the capabilities of the browser.
  • Finally, it binds all of the required scripts into a single script library and returns this to the browser.

This whole operation can be carried out by a Domino server in a fraction of a second. The Web browser is unaware that it is receiving a dynamically created script from the library.

Security is enforced since the registration of requesting pages in a database means that script is sent only to that page. The script is not returned to a user who has typed the library address into a browser bar, nor to pages on unauthorized sites. Alternatively, security could be based on permitted network domains or passwords.

Further, the browser gets only the scripts it needs -- the Domino server selects the required functions for the selected version of JavaScript (or JScript) and ignores all other code.

From the above model, it can be seen that there are three prerequisites for a Notes database to be able to supply dynamic scripts:

  • Information on the capabilities of each browser model;
  • Documents containing packages of script functions, with multiple versions where required to handle different versions of JavaScript, or different document object models;
  • Documents describing sites, with a list of script packages required by that site. Alternatively, a list of required scripts could be passed as a variable to the Web agent.

Giving the job of detecting the browser model to the Domino server means simplified JavaScript -- there's no need to write the detection code in the script, nor to continually check which code to execute. You can create a version of script that knows it will always be run in an Internet Explorer 5 JavaScript 1.3 browser, and another which knows it will be limited to JavaScript 1.1.


« 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
Syncing Notes with Android phones
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
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: Online safety for virtual learning
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Seek and find: Strategies to locate filed-away emails fast
-- 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 --

Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.

Register by April 10 to save $200.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login