I made a PHP class for search database with some methods. i.e LIKE
, FULL TEXT
and ...
I did test it on a huge database. The search speed was great, so I started to use this script in my page.
I decided to use AJAX to speed up stuff...
This is my ajax code :
$.ajax({
type: "POST",
data: publisher + '&blur=true',
url:"server/advance2.php",
ifModified: true, /* tested with and without this */
cache: true, /* tested with and without this */
statusCode: { 404: function() {
$('#target').html('<h4 class="col-md-offset-4 col-md-3 textRed textCenter farsi">Error...</h4>');
}//404
},//statusCode
beforeSend: function() {
$('#target').html('<img src="e995a9c2864f.gif" class="col-md-offset-4 col-md-3" alt="We are searching, please wait"/>');
},
success: function(result) {
$('#target').html(result)
}
});//Ajax Request After Blur
but the search speed significantly decreased.
Would you tell me why it's happening, and how I can fix it?