我可以用jquery解析xml。现在我想要解析的文本是一个超链接而不是简单的文本。以下是我写的。添加一个链接到一个XML标签,并用jquery解析它
$(xml).find("customers")
.each(function(){
$("#guys").append("<div class="mybox"><a href="+$(this).find('customer_link').text()+"target="_blank">"+$(this).find('customer_company').text()"</a></div>");
});
这里是XML
<customer_company><![CDATA[Google<br>]]></customer_company>
<customer_link>http://www.google.com</customer_link>
</myguys>
<myguys>
<customer_company><![CDATA[EMC<br>]]></customer_company>
<customer_link>http://www.emc.com</customer_link>
</myguys>
</info>
我知道有没有错的逻辑,我认为这仅仅是与标签语法错误。有谁能告诉我在哪里,我在这里做了一个错误,指向我一个很好的教程
我已经为你编辑了它,但是建议你多花一点时间把代码放在一边,如果你再次发布。 :-) – 2011-03-18 14:58:54