JQuery 读取 xml

<script language="JavaScript">
$.get("cities.xml",function(xml){
var domEle = xml;
var $province = $(domEle).find("province");
$province.each(function(i,domPro){
var $proName = $(domPro).attr("name");
var $option = $("<option></option>");
$option.attr("value",$proName);
$option.text($proName);
$("#province").append($option);
});
});

</script>

你可能感兴趣的:(JQuery 读取 xml)