jQuery Autocomplete with WordPress

Assuming you know something about plugin development, I want to share a piece using jQuery autocomplete the WordPress way.

Ajax calls have been around and jQuery autocomplete has been, but you do not see them as much together in examples the WordPress way.

The included scripts

And the function to get posts