|
|
|
|
|
|
|
|
|
|
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.
[ Prev | Next ]
|
|
|
|
|
|
-- Advertisement --
2-Minute Tutorials
How do I...
- integrate MS Office or OpenOffice with Notes?
- create cross-tab reports and charts?
- print serial letters and mailing labels?
- create PDFs in Lotus Notes?
Check out the 2-minute tutorials here. |
-- Advertisement --
SECURTRAC - MONITOR AND CONTROL YOUR DOMINO ENVIRONMENT
When it comes to your business, how do you ensure compliance with SOX, HIPAA or other industry driven regulations? Use SecurTrac to monitor and audit the life cycle of all objects in your Domino environment.
- Database Monitor
- Mail Monitor
- Domino Directory Monitor
- Notes.ini File Monitor
- Intrusion Detection Monitor
Click here for details and a free evaluation copy. |
|
|
|
|
|
|