jquery - how to prevent ajax returned json encoded result to appear in console? -
i'm trying build autosuggeset feature in website. users enter in text field, ajax send data php side, ran query in database, , return result array page. problem don't want browser console shows what's being returned.
here basic structures:
main.php:
<input type="text" id="title" /> <div id="suggest_box" style="display:none"></div>
javascript:
$("input#title").keyup(function(){ var url = "suggest.php"; var data = $(this).val(); $.post (url, data) .success (function(result){ var jsonobj = $.parsejson( result ); var suggestobj = jsonobj.title_list; }); });
suggest.php
// returning result array $json = new stdclass(); $json->title_list = $result; echo json_encode($json, json_unescaped_unicode);
i have checked autosuggest feature in other popular websites, didn't show in console, doing wrong?
Comments
Post a Comment