function saveWish(value) { window.location.href='/login.html'; } function postWishlist(method, value) { let cnts = 0; $.ajax({ url: "/papi/addwish.html", type: "post", data: {'method': method, 'value': value, '_csrf-frontend': 'xe43oCxQZEV3bMgn1VHZ05XiP45rzUioKPTZ-3TVhm-VgXzTRT0iDj9YoE-_Oqj-56pV2V-jeelBlb2PIuPHVg=='}, dataType: "json", async: false, success: function (data) { if(data["rst"] == "success") { if(data["act"] == "add") { $(".fav"+value).css("color","#f44336"); $(".fav"+value).removeClass("bi-heart"); $(".fav"+value).addClass("bi-heart-fill"); } else { $(".fav"+value).css("color","#f44336"); $(".fav"+value).removeClass("bi-heart-fill"); $(".fav"+value).addClass("bi-heart"); } } }, error: function (data) { }/*function结束*/ });/*ajax结束*/ return cnts; } $(document).ready(function () { wlist = []; });