1// AJAX call for autocomplete
2$(document).ready(function(){
3 $("#search-box").keyup(function(){
4 $.ajax({
5 type: "POST",
6 url: "readCountry.php",
7 data:'keyword='+$(this).val(),
8 beforeSend: function(){
9 $("#search-box").css("background","#FFF url(LoaderIcon.gif) no-repeat 165px");
10 },
11 success: function(data){
12 $("#suggesstion-box").show();
13 $("#suggesstion-box").html(data);
14 $("#search-box").css("background","#FFF");
15 }
16 });
17 });
18});
19//To select country name
20function selectCountry(val) {
21$("#search-box").val(val);
22$("#suggesstion-box").hide();
23}