我是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 - jQuery在页面之间传递数据,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12226564/