How to read view content using jquery in Domino _jquery

Source: Internet
Author: User
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.

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.