내 코드 brands.xml
가 포함되어있는 경우 <table name="brands">
경고의 단일 항목 개체 개체를 표시하지만 내 brands.xml이HTML에 대한 각
<table name="brands">
<column name="BrandID">1</column>
<column name="BrandName">AX</column>
<column name="CompanyInfo">FDC</column>
<column name="Composition">Cap</column>
</table>
<table name="brands">
<column name="BrandID">2</column>
<column name="BrandName">UP</column>
<column name="CompanyInfo">Tor</column>
<column name="Composition">Asp</column>
</table>
인이
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
} else {
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","brands.xml",false);
xmlhttp.send();
theXmlDoc=xmlhttp.responseXML;
function fillForm(){
$(theXmlDoc).find('table[name=brands]').each(function(){
alert($(this));//doesn't fire when brands.xml contains more than one entry of <table name="brands"> else shows Object object
});
입니다 내가 포함 할 때 위에 표시된 것처럼 하나 이상의 테이블 이름이 실행되지 않습니다.
당신이 XML을 통과하기 위해 jQuery를 사용하는 특별한 이유가 있나요를 볼 수 있지만 그것을 검색하지? –
jquery에는 물건을 다루는 메소드가 많이 있다고 생각합니다. html pls에서 xml에 액세스하는 더 나은 방법이 있다면 알려주세요. 텍스트를 가져오고 싶지만 일단 XML 노드에서 루프를 돌릴 수는 있습니다. – saum22