I have searched a lot (especially on stackoverflow) but no one works on me. On localhost, the codes are simpler than on live web. On live web, i use functions (PHP). The AJAX codes are similar. It works on localhost but doesnt on live web. The code below is used for <select>
AJAX
$(document).ready(function(){
$("#type").change(function(){
var type_id=$(this).val();
$.ajax({
type: 'POST', //method
url: 'subtype.php', //action
data: 'type_id='+type_id,
success: function(response){
$("#subtype").html(response);
}
});
});
});
While in subtype.php, the receiver of AJAX is $type_id=$_POST['type_id'];
I've tried console.log
but there's no error, it shows the id when I put console.log(type_id)
(that makes me sure that my codes are correct)
Any suggest for me where I should fix?