Home > Web Front-end > JS Tutorial > body text

How to use jQuery to read view content in Domino_jquery

WBOY
Release: 2016-05-16 18:43:56
Original
1439 people have browsed it

jQuery is a fast, concise javaScript library that enables users to more easily process HTML documents and events, implement animation effects, and easily provide AJAX interaction for websites or systems.
Using the jQuery framework in Domino can greatly simplify the js code and make the js program more concise and intuitive. Here is a simple example of simply using jQuery to read the view content in the form.
1. Add the following code and built-in HTML to the form:
html code:

< ;div id="ViewContent">

The
button calls the function, and the div is used to receive the view content obtained by the function and display it.
Add the following JavaScript function to the jsheader of the form:

Copy the code The code is as follows:

function GetViewContent(){
var url = server path/database name/view name?readviewentries"
$.get(url,function(data){
var list = "";
list = "
"
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 ="})
}
})
}
list = "
" $(this).text() " " $(this).next().text() "" $(this).next().next().text() "
"
$("#ViewContent").html(list);
});
}

Note: The prerequisite for this code to run successfully is that you remember to call jQuery in the form .js files.
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!