0

I'm using jQuery Cookie 1.4.1. Here's my code:

<!DOCTYPE html>
<html lang="en">
  <head>
  </head>
  <body>
    <a href="#" onclick="test()">test</a>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script src="jquery.cookie.js"></script>
    <script>
      function test() {
        $.cookie('name', 'value');
        console.log($.cookie('name'));
      }
    </script>
  </body>
</html>

The console shows "undefined"

Could anyone help me?

user748455
  • 385
  • 1
  • 3
  • 10

1 Answers1

0

I'm developing on localhost. It seems that Chrome ignores local jQuery cookies:

Why does Chrome ignore local jQuery cookies?

Community
  • 1
  • 1
user748455
  • 385
  • 1
  • 3
  • 10