0
我正尝试使用Zoho Creator API来获取XML文件,其中包含可在新的HTML文档中访问的记录,并从插入的XML文件中获取特定值。在这里看到的jsfiddle http://jsfiddle.net/vm5m6/从Zoho Creator API获取XML数据
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","https://creator.zoho.com/api/xml/uownrealestate/view/Agent_Roster_View? authtoken=***scope=creatorapi",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
document.write("<table border='1'>");
var x=xmlDoc.getElementsByTagName("record");
for (i=0;i<x.length;i++)
{
document.write("<tr><td>");
document.write(x[i].getElementsByTagName("value")[0].childNodes[0].nodeValue);
document.write("</td><td>");
}
document.write("</table>");
我使用谷歌的Fusion Tables要做到这一点,以及还考虑代码。如果任何人有任何建议,从一个容易组织的外部数据库中提取非常简单的数据,请让我知道。
我也试过,但读的地方,如果XML是另一个域
$(function() {
var xml = 'https://creator.zoho.com/api/xml/uownrealestate/view/Agent_Roster_View?authtoken==creatorapi'
$(xml).find("record").each(function() {
var stateName = $(this).find("Agent_Name").text();
alert("State: " + stateName);
})});
非常感谢!我得到了这两种方法的工作,但我相信将它存储为JSON对象将更多的流,因为我只是简单地使用值而不是显示它们。请帮助我下一步如何编辑/搜索JSON变量。 '$(函数(){ \t \t $。每个(json.Customer_Files,功能(I){ 如果(i.Address == “10908 Woodchase圈”){ 警报(i.Seller_Name); 回报; } })});' – GO3DExpansion
NEVERMIND!我得到它的工作!非常感谢!!!!! – GO3DExpansion