Ajax is especially convenient to use and there is no worries about browser compatibility. Use ajax to call the content on the XML page to generate a three-level linkage. I don't need to talk much about it. Follow me to write it step by step.
First, write an XML file. Data. xml
<? Xml version = "1.0" encoding = "UTF-8"?> <List> <province name = "Henan" id = '1'> <city name = "Jiaozuo" id = '11'> <area id = '000000'> Wuzhi </ area> <area id = '000000'> boai </area> <area id = '000000'> xiuwu </area> </city> <city name = "Zhengzhou" id = '12'> <area id = '000000'> jinshui district </area> <area id = '000000'> Zone 2 and 7 </area> <area id = '000000'> Central Plains district </area> </city> </province> <province name = "Hebei" id = '2'> <city name = "Shijiazhuang" id = '21'> <area id = '000000'> Zhao County </area> <area id = '000000'> Zhengding </area> <area id = '000000'> Pingshan </area> </ city> <city name = "Chengde" id = '22'> <area id = '000000'> Field </area> <area id = '000000'> Fengning </area> <area id = '000000'> Longhua </area> </city> </province> <province name = "Shandong" id = '3'> <city name =" qingdao "id = '31'> <area id = '000000'> licang </area> <area id = '000000'> Laoshan </area> <area id = '000000' '> Huangdao </area> </city> <city name = "Rizhao" id = '32'> <area id = '000000'> Donggang </area> <area id = '000000'> lanshan </area> <area id = '000000'> wulian </area> </city> </province> </list>
Then we need to use ajax to call XML to generate a three-level linkage.
Below is the Code Section
<! DOCTYPE html>
OK. According to this three-level linkage, N-level linkage can be extended. The principles are the same. Okay, that's it.