我在点击一个链接时创建/设置一个cookie有问题,有没有适当的方法来做到这一点?无论是PHP或Javascript都很好。点击设置Cookie
<html>
<a href="2.html" id="cookie">
<div class="yes">
<p>Yes</p>
</div>
</a>
</html>
<script>
$("a#cookie").bind("click", function() {
});
</script>
<?php
setcookie("cookie")
?>
很明显,JS和PHP不会存在于同一个实例中,它只是为了展示我有什么。
仍然无法正常工作。 w/only javascript –
@EricERK http://jsfiddle.net/zccepspa/它应该工作。 – Zsw
我想我只是不知道我在做什么。 –