jQuery four-level linkage drop-down menu code
Part of js code
<script type="text/javascript">
var $town = $('#demo3 select[name="town"]');
var townFormat = function(info){
$town.hide().empty();
if(info['code']%1e4&&info['code']<7e5){ //Whether it is a "district" and not Hong Kong, Macao and Taiwan
$.ajax({
url:'http://passer-by.com/data_location/town/'+info['code']+'.json',
dataType:'json',
success:function(town){
$town.show();
for(i in town){
$town.append('<option value="'+i+'">'+town[i]+'</option>');
}
}
});
}
};
$('#demo3').citys({
province:'Fujian',
city:'Xiamen',
area:'Siming',
onChange:function(info){
townFormat(info);
}
},function(api){
var info = api.getInfo();
townFormat(info);
});
</script>
All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn
Related Article
16 May 2016
This article mainly introduces the jQuery code to implement multi-level drop-down menus with animation effects, which can achieve the effect of fading in and out when clicked. It involves the traversal and chain operation of jQuery page elements. It has certain reference value. Friends who need it can For reference
16 May 2016
This article mainly introduces jQuery to implement magic tree drop-down menu effects. The code is simple and very practical. Friends in need can refer to it.
16 May 2016
This article mainly introduces the jQuery three-level drop-down list navigation menu. It is recommended to everyone. Friends who need it can refer to it.
02 Apr 2018
This time I will bring you the implementation of ajax three-level linkage drop-down menu (with code). What are the precautions for implementing ajax three-level linkage drop-down menu? Here is a practical case, let's take a look.
12 Dec 2016
jquery+json universal three-level linkage drop-down list, there are three versions of implementation in the code
16 May 2016
Implemented with Jquery. The original code only supports IE. I changed it here. There are three versions of implementation in my code.
16 May 2016
This article mainly introduces jQuery’s implementation of exquisite multi-level drop-down menu effects, which is mainly realized by relying on jQuery’s fg.menu.js plug-in. The effect is very good, and I recommend it to everyone.
23 Mar 2017
This article introduces the example code to implement ajax three-level linkage drop-down menu
16 May 2016
This article mainly introduces a secondary linkage drop-down menu implemented by the combination of jQuery, PHP and MySQL. Friends in need can refer to it.
Hot Tools
jQuery2019 Valentine's Day Confession Fireworks Animation Special Effects
A very popular jQuery Valentine's Day confession fireworks animation special effect on Douyin, suitable for programmers and technical geeks to express their love to the girl they love. No matter you choose to be willing or not, you have to agree in the end.
layui responsive animated login interface template
layui responsive animated login interface template
520 Valentine's Day confession web animation special effects
jQuery Valentine's Day Confession Animation, 520 Confession Background Animation
Cool system login page
Cool system login page
HTML5 tape music player-CASSETTE PLAYER
HTML5 tape music player-CASSETTE PLAYER