JavaScript code for cookie not working in Chrome

后端 未结 5 1351
谎友^
谎友^ 2021-01-01 16:59

The following code works fine in FF:

var date = new Date();
date.setTime(date.getTime() + (1 * 24 * 60 * 60 * 1000));
expires = \"; expires=\" + date.toGMTSt         


        
5条回答
  •  清酒与你
    2021-01-01 17:04

    Seems like it's working for me:

    enter image description here

    http://jsfiddle.net/rQEnF/3/

    At least the cookie shows up in dev tools, as you can see. However, I replaced the jQuery selector $('#orderdetailid').val() with a constant value, as you can see. Is there something wrong with that value or the element containing the value maybe?

提交回复
热议问题