データベースからのデータを表示しているドロップダウンボックスがあります。データを選択すると、選択したときにページがすぐに更新されませんが、5秒後にページが更新されます。これを修正する方法を教えてください。私のコード:
Javascript:
$(function() { document.ready
$("#client").on("change", function() {
var ID=$(this).attr('id');
var clientid=$("#client").val();
$.ajax({
type: "POST",
data: {
clientselect: $(this).val()
},
success: function(data) {
$("#display").html(data);
window.location = '?action=clientnetworkpricelist&clientid='+clientid+'';
$("#flash").hide();
}
});
});
});
HTML
<select name="client" id="client" style="margin:-24px 0 0 1px;background-color:#E8E8E8;width:104px;position: absolute;">
<option value="">Select Client</option>
<?php
$sql=mysql_query("select * from client_list");
$clientid=$_GET['clientid'];
while($row=mysql_fetch_assoc($sql))
{
if(strlen($_GET['clientid'])>0 && $_GET['clientid']==$row['clientid']){
print' <option id="client" name="client" value="'.$row['clientid'].'" selected>'.$row['clientid'].' </option>';}
else{
print' <option id="client" name="client" value="'.$row['clientid'].'" >'.$row['clientid'].' </option>';
}
}
?>
</select>