I am having a problem that has me perplexed.
I have a simple webpage that works using php and mysql. I am trying to conver this to node.js and mysql.
There are 2 dropdown select boxes the first contains a list of customers that is taken from the database. (This works well)
when a customer is selected I need the second box to contain a list of instruments that belong to the customer.
I have this working great in the php version but in the node.js version the second dropdown does not get up[dated and the console has and error that states Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience.
Does this mean I can not use this code or better yet how do I change this script to make it work properly??
$(document).ready(function(){
$("select#cust").change(function(){
var cust_id = $("select#cust option:selected").attr('value');
var test = $("#test").val();
var din = $("#idate").val();
$("#inst").html( "" );
if (cust_id.length > 0 ) {
$.ajax({
async: true,
type: "GET",
async: true,
url: "fetch_inst",
data: "cust_id="+cust_id,
cache: false,
beforeSend: function () {
$('#inst').html('<img src="loader.gif" alt="" width="24" height="24">');
},
success: function(data) {
$("#inst").html( data );
}
});
}
});