JQuery is a fast and concise javaScript library that allows you to easily process HTML documents, events, and animation effects, and provides AJAX interaction for websites or systems.
Using the jQuery framework in Domino can greatly simplify js Code and make javascript programs more concise and intuitive. The following is a simple example. jQuery is simply used in forms to read View content.
1. Add the following code to the form with built-in HTML:
Html code:
<Input type = button onclick = "GetViewContent ()" value = "Get View content">
<Div id = "ViewContent"> </div>
The button calls the function. The div is used to receive and display the View content obtained by the function.
Add the following JavaScript Functions to the jsheader of the form:
Copy codeThe Code is 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 = '000000'> <TR> <TD> <TABLE width = '000000' 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" pai.html (list );
});
}
Note: before the code runs successfully, remember to call the jQuery. js file in the form.