当前页面: 开发资料首页 → Javascript 专题 → XML在Web中的简单应用
摘要: XML在Web中的简单应用
http://expert.csdn.net/Expert/topic/2241/2241772.xml?temp=.8590967
http://expert.csdn.net/Expert/topic/2241/2241772.xml?temp=.8590967是这个问题,促使我写下了这篇文章。虽然没有多高的技术含量,却也是不错的IE WEB开发技巧。
首先建立一个Area.html,很简单包含一个省份的select元素和一个城市的界面元素:
<head>
for(idx = 0; idx < cities.length; idx ++) {
name = cities[idx].getAttribute("name");
cityobj.options.length++;
cityobj.options[cityobj.options.length - 1].value = name;
cityobj.options[cityobj.options.length - 1].text = name;
}
}
</script>
</body>
然后建立三个省份的城市数据文件,分别命名为city01.xml,city02.xml,city03.xml
<?xml version="1.0" encoding="GB2312"?>
<?xml version="1.0" encoding="GB2312"?>
<?xml version="1.0" encoding="GB2312"?>
保存,在ie6浏览通过,理论上可以在ie5一上浏览器跑。
zlyperson@163.net
</td> </tr> <tr> <td vAlign=top align=left height="100%">