I'm facing problem with ajax call.
Here is my limk where i'm using ajax call http://www.cholokhai.com/resturant/test-demo/
I have included script in footer file
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
and code of ajax call is:
jQuery("#next_button").click(function(e){
jQuery(".fetch_data").hide();
jQuery(".booking_confirm").show();
var selected_date = jQuery("#selected_date").text();
var selected_persons = jQuery("#selected_persons").text();
var selected_discount = jQuery("#discount_time").text();
var selected_price = jQuery("#discount_price").text();
var filled_name = jQuery("#selected_name").val();
var filled_email = jQuery("#selected_email").val();
var filled_phone = jQuery("#selected_phone").val();
var postData = 'name='+filled_name+'&email='+filled_email+'&phone='+filled_phone+'&date='+selected_date+'&persons='+selected_persons+'&time='+selected_discount+'&discount='+selected_price;
jQuery.ajax({
url : "http://www.cholokhai.com/ajax",
type: "POST",
data : {v:postData},
dataType: 'json',
success: function(html)
{
jQuery(".booking_confirm").show();
}
});
return false;
});
When im using variables not string in data like: data{name: filled_name, email: filled_email} im getting 404 error.
I don't know why its not working. Please help me to resolve this issue. Thanks.