有问题的页面在这里: http ://ezup.com/csg/gt.html
在 Firefox 中,警报框会触发,但随后页面会自动转发而无需等待用户的任何输入。这在 IE 和 Chrome 中有效,但 Chrome 似乎无法识别 cookie...
<script type="text/javascript">
$(document).ready(function(){
(".buy > a").click(function(){
//alert($.cookie("firstClick"));
if($.cookie("firstClick") != 1){
$.cookie("firstClick", "1");
alert("You will now be directed to the Shopping Cart page. Please use your browser's back button to return to the CSG store.");
}
else if($.cookie("firstClick") == 1){
}
});
});
</script>
<body>
<ul>
<li class="buy">
<a href="http://store.ezup.eu/ShoppingCart.asp?ProductCode=EC2HSF1010W&ProductCode=EC1010402142T">L
<button type="button">Add to Cart</button>
</a>
</li>
</ul>
</body>