jquery is a fast, concise JavaScript library that makes it easier for users to handle HTML documents, events, animations, and easily provide Ajax interaction for a Web site or system.
Using the jquery framework in Domino can simplify the JS code a lot, and make the JS program more concise and intuitive, here is a simple example of using jquery in the form to read the view content.
1. Add the following code to the form and built-in HTML:
HTML code:
<input Type=button onclick= "getviewcontent ()" value= "Get View Content" >
<div id= "ViewContent" ></div>
button to call the function, the div is used to receive the view content that the function obtains, and displays it.
Add the following JavaScript functions to the Jsheader of the form:
Copy Code code as follows:
function Getviewcontent () {
var url = Server Path/database name/view name? readviewentries "
$.get (url,function (data) {
var list = "";
List + = "<table border= ' 1 ' cellspacing= ' 0 ' cellpadding= ' 3 ' width= ' 100% ' ><tr><td><table ', width= ' 100% ' border= ' 1 ' > '
if ($ (data). Find ("Viewentry"). Size = = 0) {
} else {
$ (data). Find ("Viewentry"). each (function () {
if ($ (this). attr ("position") < 11) {
$ (this). Find ("Entrydata"). each (function () {
if ($ (this). attr ("name") = = "Name")
list+= "<tr><td>" +$ (This). Text () + "</td><td>" +$ (This). Next (). Text () + "</TD><TD > +$ (This). Next (). Next (). Text () + "</td></tr>";
})
}
})
}
List = "</TABLE></TD></TR></TABLE>"
$ ("#ViewContent"). HTML (list);
});
}
Note: The prerequisite for this code to run successfully is to remember to invoke the Jquery.js file in the form.