Twitter Typeahead: Upgrading to the latest version using the same function

150 Views Asked by At

I'm currently using the Bootstrap-typeahead plugin, this way:

$('.patients_typeahead').typeahead({
                    name: 'patientshomepage',
                    source: function (query, process) {
                        $.ajax({
                            url: 'source.php',
                            type: 'POST',
                            query: 'query=' + query,
                            dataType: 'JSON',
                            async: true,
                            success: function (data) {
                               process(data);
                            }

                        })
                    }



                });

I want to upgrade to the latest typeahead, but I understood that the source: function() isn't supported anymore. How can I convert my code so I could use the latest twitter-typeahead?

0

There are 0 best solutions below