I m using following jquery code
var ajax_url = "tmp/ajax.php";
$(document).on('click', 'input[name="radio_view"]', function () {
var view_array = {};
view_array.session_id = $(this).attr('data-session_id');
view_array.buyer_id = $(this).attr('data-buyer_id');
view_array.lot_id = $(this).attr('data-lot_id');
view_array.view = $(this).val();
$.post(ajax_url, {act: 'save_view', view_array: view_array});
});
On full view in pc it is working fine the request will be sent to tmp/ajax.php but on mobile view the request not send in Network it is showing no request captured.
Since you are using radio(As I am guessing by name attribute) button to trigger ajax call , mostly 'click' does not work in non-ie browser. Try changing from 'click' to 'change' event.
$(document).on('change', 'input[name="radio_view"]', function () {
//rest of the code
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With