如何在xml文件中使用jquery隐式搜索 [英] how to impliment searching using jquery in a xml file
本文介绍了如何在xml文件中使用jquery隐式搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用以下代码将所有记录从xml文件获取到表中
i am getting all the records from a xml file to a table using the follwing code
function view() {
var xhr = new XMLHttpRequest();
xhr.open("POST", "http://localhost:49989/WebService1.asmx/AllProduts", true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
var doc = $.parseXML(xhr.responseText);
var $xmlresponsetree = $(doc);
var rows = "";
$xmlresponsetree.find("products").each(function () {
rows += "<tr><td>" + $(this).find("productid").text() + "</td>";
rows += "<td>" + $(this).find("Productname").text() + "</td>";
rows += "<td>" + $(this).find("Categoryname").text() + "</td>";
rows += "<td>" + $(this).find("Unitprice").text() + "</td>";
rows += "<td>" + $(this).find("Productdescription").text() + "</td>";
rows += "<td>" + $(this).find("Availablestock").text() + "</td></tr>";
})
document.getElementById('results').innerHTML = rows;
}
}
xhr.send();
}
但我需要隐式搜索,排序,按下拉列表或其他内容进行过滤
可以帮我一个人吗asap
but i need to impliment searching, sorting,filtering by a dropdown or something
can some one please help me asap
推荐答案
.parseXML(xhr.responseText); var
.parseXML(xhr.responseText); var
xmlresponsetree =
xmlresponsetree =
(doc); var 行= " ;
(doc); var rows = "";
这篇关于如何在xml文件中使用jquery隐式搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文