Subject: AJAX Toolkit for Domino a Great Idea
To use AJAX, we would use HTML and cascading style sheets for the display layer, JavaScript to interact with the document object model on the client side, an XmlHttpRequest object to provide a conduit between the client and server, and XML as the data transfer protocol.
Note: For the XmlHttpRequest, MS Internet Explorer differs slightly from the others.
//////////////////////////////////////////
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else return false
//////////////////////////////////////////
For example, using a simple scenario, consider a Web Page that had a Left Frame containing a list of autos (from a NotesView) and a Right Frame that would display a picture of the car. Without Ajax, when a user clicked on an auto, the Web Page would be rebuilt entirely, to display the auto picture in a NotesDocument the Right Frame.
Using Ajax in Notes/Domino, we could assign the Right Frame an HTML ID. When a user clicked on an auto from the list in the Left Frame, Ajax type Javascript would send an XMLHttpRequest to retrieve the HTML to display the auto picture, and would replace just the Right Frame with the new HTML - thus showing the selected auto’s picture.
document.getElementById(containerid).innerHTML = page_request.responseText
The result with Ajax is that only the Right Frame is rebuilt, not the entire Web Page that non-Ajax code would require.
The savings in this example is small, but in more complicated Web pages (which is the norm), the faster response time for both the Web Client and the Web Server can be significant.
I would greatly appreciate an Ajax toolkit replete with sample real-world Notes Design Elements showing how to most effectively implement these advances using the Notes/Domino environment.
Of course, while I’m asking, I would also greatly appreciate a developer’s copy of WebSphere Portal server, too, to demo the possiblities of Notes via WebSphere!