JSON

【JSON】都道府県市区郡一覧作ってみた

都道府県と市区郡のみの一覧

東京都だけ【村】、【島】、【町】があるけど東京都以外の46道府県は市区郡のみのJSONデータです。書き方間違ってたら指摘して頂けると有難いです。

よくあるドロップダウンメニューで都道府県を選択すると次の市区町村ドロップダウンメニューが選択した都道府県内にある市区町村だけ出てくるアレみたいなのを作りたくてJSONデータとして作ってみました。

まだ実際のドロップダウンメニューを作ったわけではないですが、Ajaxで作って完成したらコードをQiitaに公開しようと思います。色々調べたけど解りやすいものが無かったので作ってしまえと思ってます。コピペで動くような物にしようと思ってます。

2017年10月11日追記
連動ドロップダウンメニュー完成、多分コピペで動く。
都道府県選択したら連動して市区郡が出てくるアレ作ってみた

2017年12月13日追記
チェックボックス版
こっちは前準備してる前提でコード載せてます。
都道府県選択したら連動して市区郡のチェックボックスが出るアレ作ってみた

pref_city.json
[{
        "01": {
        "id": "01",
        "name": "北海道",
        "short": "北海道",
        "kana": "ホッカイドウ",
        "en": "hokkaido",
        "city":[
            {"citycode":"0010001","city":"札幌市中央区"},
            {"citycode":"0010002","city":"札幌市北区"},
            {"citycode":"0010003","city":"札幌市東区"},
            {"citycode":"0010004","city":"札幌市白石区"},
            {"citycode":"0010005","city":"札幌市豊平区"},
            {"citycode":"0010006","city":"札幌市南区"},
            {"citycode":"0010007","city":"札幌市西区"},
            {"citycode":"0010008","city":"札幌市厚別区"},
            {"citycode":"0010009","city":"札幌市手稲区"},
            {"citycode":"0010010","city":"札幌市清田区"},
            {"citycode":"0010011","city":"函館市"},
            {"citycode":"0010012","city":"小樽市"},
            {"citycode":"0010013","city":"旭川市"},
            {"citycode":"0010014","city":"室蘭市"},
            {"citycode":"0010015","city":"釧路市"},
            {"citycode":"0010016","city":"帯広市"},
            {"citycode":"0010017","city":"北見市"},
            {"citycode":"0010018","city":"夕張市"},
            {"citycode":"0010019","city":"岩見沢市"},
            {"citycode":"0010020","city":"網走市"},
            {"citycode":"0010021","city":"留萌市"},
            {"citycode":"0010022","city":"苫小牧市"},
            {"citycode":"0010023","city":"稚内市"},
            {"citycode":"0010024","city":"美唄市"},
            {"citycode":"0010025","city":"芦別市"},
            {"citycode":"0010026","city":"江別市"},
            {"citycode":"0010027","city":"赤平市"},
            {"citycode":"0010028","city":"紋別市"},
            {"citycode":"0010029","city":"士別市"},
            {"citycode":"0010030","city":"名寄市"},
            {"citycode":"0010031","city":"三笠市"},
            {"citycode":"0010032","city":"根室市"},
            {"citycode":"0010033","city":"千歳市"},
            {"citycode":"0010034","city":"滝川市"},
            {"citycode":"0010035","city":"砂川市"},
            {"citycode":"0010036","city":"歌志内市"},
            {"citycode":"0010037","city":"深川市"},
            {"citycode":"0010038","city":"富良野市"},
            {"citycode":"0010039","city":"登別市"},
            {"citycode":"0010040","city":"恵庭市"},
            {"citycode":"0010041","city":"伊達市"},
            {"citycode":"0010042","city":"北広島市"},
            {"citycode":"0010043","city":"石狩市"},
            {"citycode":"0010044","city":"北斗市"},
            {"citycode":"0010045","city":"石狩郡"},
            {"citycode":"0010046","city":"松前郡"},
            {"citycode":"0010047","city":"上磯郡"},
            {"citycode":"0010048","city":"亀田郡"},
            {"citycode":"0010049","city":"茅部郡"},
            {"citycode":"0010050","city":"二海郡"},
            {"citycode":"0010051","city":"山越郡"},
            {"citycode":"0010052","city":"檜山郡"},
            {"citycode":"0010053","city":"爾志郡"},
            {"citycode":"0010054","city":"奥尻郡"},
            {"citycode":"0010055","city":"瀬棚郡"},
            {"citycode":"0010056","city":"久遠郡"},
            {"citycode":"0010057","city":"島牧郡"},
            {"citycode":"0010058","city":"寿都郡"},
            {"citycode":"0010059","city":"磯谷郡"},
            {"citycode":"0010060","city":"虻田郡"},
            {"citycode":"0010061","city":"岩内郡"},
            {"citycode":"0010062","city":"古宇郡"},
            {"citycode":"0010063","city":"積丹郡"},
            {"citycode":"0010064","city":"古平郡"},
            {"citycode":"0010065","city":"余市郡"},
            {"citycode":"0010066","city":"空知郡"},
            {"citycode":"0010067","city":"夕張郡"},
            {"citycode":"0010068","city":"樺戸郡"},
            {"citycode":"0010069","city":"雨竜郡"},
            {"citycode":"0010070","city":"上川郡"},
            {"citycode":"0010071","city":"勇払郡"},
            {"citycode":"0010072","city":"中川郡"},
            {"citycode":"0010073","city":"増毛郡"},
            {"citycode":"0010074","city":"留萌郡"},
            {"citycode":"0010075","city":"苫前郡"},
            {"citycode":"0010076","city":"天塩郡"},
            {"citycode":"0010077","city":"宗谷郡"},
            {"citycode":"0010078","city":"枝幸郡"},