Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master
47 lines (40 sloc) 1.327 kB
<!DOCTYPE html>
<html lang="en">
<title>Ajax-Chosen: Bootstrapping a Popular jQuery Plugin to add Ajax Autocomplete</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src="/dist/chosen/chosen/chosen.jquery.min.js"></script>
<script type="text/javascript" src="/lib/ajax-chosen.js"></script>
<link type="text/css" rel="stylesheet" href="/dist/chosen/chosen/chosen.css" />
<style type="text/css">
#example1, #example2, #example3 { width: 300px; display: block; }
<script type="text/javascript">
$(document).ready(function () {
type: 'GET',
url: '/data.json',
dataType: 'json'
}, function (data) {
var terms = {};
$.each(data.states, function (i, val) {
terms[i] = val;
return terms;
<h1>Ajax-Chosen: Bootstrapping a jQuery Plugin</h1>
<h2>Multi Select</h2>
<select id="example1" title="Search for a state" multiple></select><br /><br />
<select id="example3" title="Search for a state" multiple></select>
<h2>Single Select</h2>
<select id="example2" title="Select for a state" search><option></option></select>
Jump to Line
Something went wrong with that request. Please try again.