1.2.1 • Published 10 years ago
neat_complete v1.2.1
Neat Complete
A light-weight and library-less widget for simple autocompletion.
Integrating
Simple example using jQuery:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link href="./lib/neat_complete.css" rel='stylesheet'>
</head>
<body>
<input type='text' id='ac_field' />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src='./lib/neat-complete.min.js'></script>
<script type="text/javascript">
var widget;
$(document).ready(function(){
widget = new NeatComplete.Widget(document.getElementById('ac_field'));
widget.addService('demo',function(query, callback_fn){
$.getJSON("/path/to/service.json", function(data){
var results = $.map(data, function(result){
return { value: result.name, data: result }
});
callback_fn(query, results);
});
});
});
</script>
</body>
</html>
See more examples.
Contributing
Prerequisites
node.js - http://nodejs.org/
grunt - http://gruntjs.com/
bower - http://bower.io/
Setup
$ npm install
$ bower install
Development Compiling
$ grunt serve
Production Compiling
$ grunt
Running Tests
$ grunt test
1.2.1
10 years ago