I have problem with autocomplete. My jQuery version is 1.11.0.min, jquery ui is 1.9.1.min and ajax autocomplete for jQuery is 1.2.7. That is my jquery code:
$(function () {
$('.client').autocomplete({
source: 'ajax/getusers',
minLength: 2,
onSelect: function (suggestion) {
}
});
});
That is my ajax/getusers action:
class AjaxController extends Zend_Controller_Action
{
public function init() {
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
}
public function getusersAction()
{
$dbClients = new Application_Model_DbTable_Clients();
$dbClients->getClientsInfoByName('v');
}
}
When I open ajax/getusers function getClientsInfoByName return:
[{"id":"1","value":"vel vele","label":"vel vele"}]
But why have error message:
Error: SyntaxError: JSON.parse: unexpected character Source File: http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js