nicolasbize/magicsuggest — pull request #165 by carloslino (2014-08-11 13:28:28+00:00)
Title: Update magicsuggest.js

Hello,

I would suggest an improvement to allow customizing the result of ajax. I have a service that returns json text no.

To solve my problem, I implemented this change:

added the default parameter:
```
formatResultAjax: function (asyncData) {
return JSON.parse (asyncData)
}
```
And the success of the ajax function _processSuggestions modified the line # 797:

```
json = typeof (asyncData) === 'string'? JSON.parse (asyncData): asyncData;
```

to:

```
json = typeof (asyncData) === 'string'? cfg.formatResultAjax (asyncData): asyncData;
```