Hi they all,

I want make autocompleted searching for my site. I find HTML5 autocompleted script in google. I use Laravel and PHP and MongoDB.

My script PHP Code for search autocompleted.
PHP Code:
publicfunction searchAutoCompleteAjax(){
$keyword =Input::get('keyword');
$result = array();if(!empty(trim($keyword))){
$mongoResult =MongoDB::instance(true)->collection("items")->like('name',$keyword)->limit(0,10)->fetch();
if(
$mongoResult){foreach($mongoResult as $key => $item){
$result[]= $item['name'];}}}
echo 
json_encode(array("error"=>0,"message"=>"Success","result"=>$result));} 
I result 10 query
PHP Code:
$mongoResult =MongoDB::instance(true)->collection("items")->like('name',$keyword)->limit(0,10)->fetch(); 
My old javascript code and working for me.
My old javascript code:
PHP Code:
function searchAutoComplete(){
    var 
keyword = $("#search-box").val();
    $.
post("/home/ajaxActions",
            {
"keyword":keyword"action""search-auto-complete"},
            function(
response){
                
response = $.parseJSON(response);
                if(
response.error == 0){
                    $(
'.autocomplete-suggestions').html('');
                    $(
'.autocomplete-suggestions').css('display','block');
                  
                    $.
eachresponse.result , function( keyvalue ) {
                        
console.log(value);
                        $(
'.autocomplete-suggestions').append('<div class="autocomplete-suggestion" onclick="autoComplateClick('+key+')" id="'+key+'">'+value+'</div>');                      
                    });
                }
                else{
                    
//console.log(response.result)
                    
sweetAlert("Hata"response.message"error");
                    
//bootbox.alert(response.message);
                
}
            });

But i not running in my new javascript code.
My new Java Script Code:
PHP Code:
$(function(){
  var 
currencies = [  ];
  
currencies.push('i want query1 this area''i want query2 this area''i want query3 this area''i want query4 this area''i want query5 this area''i want query6 this area''i want query7 this area''i want query8 this area''i want query9 this area''i want query10 this area' );
  $(
'#search-box').autocomplete({
    
lookupcurrencies,
    
onSelect: function (suggestion) {
    var 
keywords suggestion.value;
    
//var rkeywords = urlTitle(keywords);
    
var rkeywords keywords.replace(/\ /g,'-').replace(/\//g,'-').replace(/\(/g,'').replace(/\)/g,'');
    
location.href "/arama/"+rkeywords;
  
    }
  });
}); 
i want check query-1, query-2, query-3, ..... query-10.

Pls help me my old java script code how to apply my new java code?