You are returning json
formatted objects in suggestion.php
but using it as HTML
in script_suggestion.php
.
Either update suggestion.php
to return a HTML snippet or have the javascript in script_suggestion.php
decode the json and use that to build the suggestions.
Example HTML output:
echo "<ul>";
foreach($arr as $suggestion){
echo "<li>".$suggestion."</li>";
}
echo "</ul>";