开发者

read cookie value in jquery

开发者 https://www.devze.com 2023-04-06 21:52 出处:网络
I have called one php page inside the iframe I have stored some values in cookies.I want to read that cookies values from that page to other page.

I have called one php page inside the iframe

I have stored some values in cookies.I want to read that cookies values from that page to other page.

I used jQuery to read cooki开发者_如何学Pythone.

var value = $.cookie('artname');

'artname' is the cookie name.

But it displaying null value because cookies path is different,path is "/v/abcfile/frontend/".

But the path for the other cookies on the page i am trying to get is "/.

I tried with this: top.jQuery.cookie('artname'); Its still showing me the same.

how can I get value of cookie?


just use the path property

$.cookie("example",  { path: '/' });

http://www.electrictoolbox.com/jquery-cookies/

cheers

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号