How to Use jQuery to read View content in Domino

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.