this question has been asked before but the answers seem not to work on me. My Ajax returns the whole page when i perform a autocomplete search
ajax to search from database
$(function(){ $(".search_keyword").keyup(function() {
var search_keyword_value = $(this).val();
var dataString = 'search_keyword='+ search_keyword_value;
if(search_keyword_value!='')
{
$.ajax({
type: "POST",
url: "/ajax/search.php",
data: dataString,
cache: false,
success: function(html)
{
$("#result").html(html).show();
}
});
} else{
document.getElementById('result').innerHTML ='';
}
return false; });
html page
<form method="get" action="/?page=results" class="navbar-form" autocomplete="off">
<input type="text" name="query" class="search_keyword"/>
<button type="submit" nam>Search</button>
</form>
<div id="result"></div>
would really appreciate the help Guys