",//Province
City: "Changsha",//Cities
Dist: "Yuelu",//Counties
nodata: "None"//when subset has no data, hide select
});
Of course, you can also expand, customize the Drop-down list option data, you can set the Drop-down content as needed, note that the data format must be in JSON format.
$ ("#city"). Cityselect ({
url:{"citylist": [
Html
First, the jquery library and the Cityselect plug-in are loaded into the head.
The code is as follows
Copy Code
Next, in #city, we put three select, and three select Set the Class property to: Prov, city, Dist, respectively, the province, the town, the district (county) three Drop-down boxes. Note If you only want to achieve the provincial and municipal two-level linkage, then remove the third dist Select.
The code is as follows
Copy
JSON data to achieve three levels of linkage between provinces, cities, and counties drop-down menu
Just a few linesCodeThat's done:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
Html
Xmlns
= "Http://www.w3.org/1999/xhtml"
>
Head
>
Title
>
Hooyes Tester
Title
>
Script
Type
= "Text/JavaScript"
SR
.
The Code is as follows:
Copy code
$ ("# City"). citySelect ({Url: "js/city. min. js ",Prov: "Hunan", // ProvinceCity: "Changsha", // cityDist: "Yuelu district", // District/CountyNodata: "none" // hide select when the subset has no data});
Of course, you can also extend the custom drop-down list option data. You can set the drop-down content as needed. Note that the data format must be in
The most important thing is to judge who according to who wrote!!! Clear Ideas!!!1, Modelsnamespacethe drop-down list linkage display _ Chinese provinces and cities _. models{ Public classCHINABF {PrivateMydbdatacontext _context =NewMydbdatacontext (); PublicListSelect () {return_context. Chinastates.tolist (); } //because all the data is in one table, it's all based on Parentareacode a
A list of traffic card chips in major cities throughout the country to see if your hometown exists ......, Traffic card
Abstract: With the continuous development of technology, traffic cards have become an indispensable part of public travel. The traffic card technology is constantly being upgraded, and each city uses different technologies. With the popularization of mobile devices, NFC also becomes more a
First on the map #region Select city/// Copyright notice: This article Bo Master original article. Blog, not reproduced without consent. WinForm List of cities to implement selected
The DNS server list of major cities in China-Linux Enterprise Application-Linux server application information. The following is a detailed description. Post: province (city) DNS name DNS IP ADDRESS
Hong Kong ns1.netvigator.com 205.252.144.228
Macao vassun2.macau.ctm.net 202.175.3.8
Shenzhen ns.shenzhen.gd.cn 202.96.134.small
202.96.154.8/202.96.154.15
Beijing ns.bta.net.cn 202.96.0.20.
Ns.spt.net.cn 202.96
},{' name ' : ' Name4 ', ' age ': 20},{' name ': ' Name5 ', ' age ': 25},{' name ': ' Name6 ', ' age ': 30},{' name ': ' Name7 ', ' age ': 35},{' name ': ' Name8 "," Age ": 40},{" name ":" Name9 "," Age ": 45}]Very standard JSON.Data, very simple, hehe.The following is a look at the deserialization of Gson, Gson provides the Fromjson () method for implementing a method from a JSON-related object to a Java entity.In everyday applications, we typically
Example of converting arbitrary Json to unordered list, and example of unordered json list
Preface
I don't know if you have found that many tree plug-ins on the Internet require fixed Json format, but you didn't consider this when generating
Json serialization and deserialization List, which of the following are json serialized into bytes? List
Using System; using System. collections. generic; using System. linq; using System. web; using System. web. UI; using System. web. UI. webControls; using Newtonsoft. json
= Mapper.readvalue (expected, arraytype); Assert.assertequals ("Ryan", Users[0].getname ());Jsonarray converted to listExpected= "[{\" a\ ": 12},{\" b\ ": 23},{\" name\ ": \" ryan\ "}]"= Mapper.gettypefactory (). Constructcollectiontype (ArrayList. Class, User. class ); // The sieze of the list is Dependon the str JSON length although the JSON content are not th
includeproperties parameter and the excludenullproperties parameter. Of course there are other methods, such as adding JSON annotations to the attributes of Pojo.6.includeProperties parameter: The attribute value to be included in the output, where the regular expression and the property name match, you can use "," to split the fill of multiple regular expressions. This parameter returns the JSON data of t
" _}]}
At the beginning, I did the parsing and didn't succeed. Always return objectNext look at the parsed example.
var callback = function(res)
{
var json = res. Content;
var array=json;
var sel = document. getElementById(' activity_id ');
If(json= =' null ') {
S
Jsona very common way of exchanging data, and because we nowWebFramework uses theEasyui(one of the most commonly usedTableTable-boundJsondata),Jsonapplication is essential, the type of data we now get from the backend database isEntities andList, all belong to the set, the nature is the same, from the entity orListturn intoJsondata to the interface is the most critical. actually Java in Json There are many kinds of parsing methods that we can use dire
JSON parsing class library Gson (2)---Generic object map, list, and JSON string interchange
---Gson class library to learn, generate and parse JSON data, and turn JSON strings to and from Java objects
First, the prefaceThis article extends the previous article and continue
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.