function getresult(url,category) { $.ajax({ url: "/inc/common/ajax/"+url, type: "GET", data: { rowcount:$("#rowcount").val(), "pagination_setting":$("#pagination-setting").val(), cat_id:category, filter : '' , }, beforeSend: function(){ $(".load-ajax-data").html(''); window.scrollTo(0, 0); $("#loader").show(); }, success: function(data){ $("#loader").hide(); if(data !== "") { $(".load-ajax-data").html(data); }else{ $("#pagination-result").html("No result found."); } var days = ""; var url3 = url.split("?"); const params = new URLSearchParams(url3[1]); for (const [key,value] of params) { // console.log(key+'>'+value); if(key == "days") { days = value; } } // $.ajax({ // url : "pages/category_count_ajax.php", // type : "GET", // data : { // id:id, // filter:filter // }, // success : function(response) // { // var json = JSON.parse(response); // var temp_count = json.count; // var temp_per_page = json.per_page; // var pageno = ""; // var url2 = url.split("?"); // const params = new URLSearchParams(url2[1]); // for (const [key,value] of params) // { // if(key == "page") // { // pageno = value; // } // } // if(!pageno) // { // pageno = 1; // } // var tot_record = temp_count; // var per_page = temp_per_page; // var start = (pageno-1)*per_page; // var count_plus = start+1; // var cnt = start+per_page; // if(cnt > tot_record) // { // cnt = tot_record; // } // if(tot_record > 0) // { // var calculate = 'Showing '+count_plus+' to '+cnt+' of '+tot_record+' results'; // }else{ // var calculate = '' ; // } // $('#pagination-count').html(calculate); // }, // }); }, error: function() {} }); } // review Ajax $(document).ready(function(){ $('#my_Form').on('submit',function(e) { e.preventDefault(); $.ajax({ url:'inc/theme/ajax/product_reviews.php', data:$(this).serialize(), type:'POST', success:function(data){ console.log(data); if(data=='success') { $("#successlogin").show().fadeOut(1000); window.location.reload(); console.log(data); $('#suu').hide(); } else if(data=='failed') { $("#error").show().fadeOut(3000); } }, error:function(data){ $("#error").show().fadeOut(3000); } }); e.preventDefault(); }); }); // add new address ajax $(document).ready(function(){ $('#myForm').on('submit',function(e) { $.ajax({ url:'inc/theme/ajax/addressAJAX.php', data:$(this).serialize(), type:'POST', success:function(data){ console.log(data); if(data != ""){ $("#success2").show().fadeOut(1000); } // window.location.href ="/checkout"; $('#myForm').trigger("reset"); } }); e.preventDefault(); }); });