Hi all, I have a slight problem with my AJAX, it’s kind of working in that it seems to be connection to my PHP file and updating but the problem seems to be in the return of the data as I just get the alert PROBLEM. If I refresh the page the new content is in place. It’s just not coming out through AJAX for some reason Any help would be appreciated
<script>
function ajaxUpdate(help){
if(help !==""){
jQuery.ajax({
type: "POST",
dataType: "json",
url: "/includes/ajax_basket_updates.php",
data: help,
success: function(data){
jQuery('#basketTable').html(data.cart);
},
error: function(){
alert('PROBLEM!');
}
});
}
}
jQuery(document).ready(function() {
//If user updates hire period...
jQuery('#pricingSelect').change(function(){
var selected = jQuery('#pricingSelect option:selected').val();
ajaxUpdate('period='+selected);
});
});
</script>