fogbugz-on-demand

Parsing XML with CDATA with JQuery

纵然是瞬间 提交于 2019-12-17 16:29:21
问题 Edit: I was missing two things here. The lack of "Content-Type:text/xml" in the header returned by the AJAX call was preventing JQuery from treating the returned data as a document. Once that was handled correctly, this code parsed correctly and output just the index and project name. $("a.getprojects").click(function(d){ d.preventDefault(); var api_token = $("#token").val(); var form_fbod = $("#fbod").val(); $.post("fbinfo.php", {fbod: form_fbod, token: api_token, cmd : 'listProjects', extra

Parsing XML with CDATA with JQuery

僤鯓⒐⒋嵵緔 提交于 2019-11-27 23:15:00
Edit: I was missing two things here. The lack of "Content-Type:text/xml" in the header returned by the AJAX call was preventing JQuery from treating the returned data as a document. Once that was handled correctly, this code parsed correctly and output just the index and project name. $("a.getprojects").click(function(d){ d.preventDefault(); var api_token = $("#token").val(); var form_fbod = $("#fbod").val(); $.post("fbinfo.php", {fbod: form_fbod, token: api_token, cmd : 'listProjects', extra:''}, function(returned_xml) { var output = ''; $(returned_xml).find("project").each(function(){ var