gpt4 book ai didi

jQuery 在页面之间传递数据

转载 作者:行者123 更新时间:2023-12-03 22:48:09 28 4
gpt4 key购买 nike

我是 jQuery 新手。有没有办法通过jQuery在另一个页面中检索booked的值?

$(document).ready(function() {
$(".active").click(function() {
var booked=$(this).val();
confirm(booked);
});
});

最佳答案

使用cookies或 HTML5 localStorage如果它纯粹在客户端。

localStorage.setItem('bookedStatus' + customerId, true);

否则使用ajax如果数据已经提交到服务器。

$.get('/site/getBookingStatus?customerId=' + customerId, function(data){
alert(data);
});

关于jQuery 在页面之间传递数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12226564/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com