0
後でチェックアウトに使用するクッキーに、選択したId(Guidsを使用)を保存したいとします。古い値を上書きせずに新しい値をクッキーに保存するにはどうすればよいですか?jQueryで複数の値をクッキーに追加
<script type="text/javascript">
$(document).ready(function() {
$('.AddProduct').click(function() {
//add following: $(this).data('id'), this is how far I got:
//$.cookie("AddedProductId", $(this).data('id'));
});
});
</script>
$(this).data('id')
foreachループから製品のIDを選択します:
<button class="AddProduct" data-ID="@item.ID">Add to Cart</button>