| Page 1 of 1 | [ 6 posts ] |
|
The following code works in IE and FF, but not in Chrome.
Code: <html> <head> <script src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script> <script type="text/javascript"> YUI().use('handlebars', 'node-base','cookie', function (Y) { Y.Cookie.set('hi', 'bye'); alert(Y.Cookie.get('hi')); }); </script> </head> <body> </body> </html> Any ideas? Thanks. |
Alberto SantiniYUI Contributor
|
|
|
Hi Alberto,
It alerts a null value for me in Chrome 19 and Chrome 20. I just got an update to Chrome 20 so I was able to test with Chrome 20 as well. For both IE 9 and FF13 it alerts 'bye'... Wonder what's going on.... |
Alberto SantiniYUI Contributor
|
Hello Daniel.
On my box (windows 7 and chrome 20) it works fine, alerting 'bye'. Maybe a cache or profile issue. Regards, IceBox |
|
Hi again
I tried debugging the issue and it seems that the "set" method in Cookie.js is not working for Chrome. The "doc.cookie" is not set with the value from "text". It's wierd b/c I see that text has the value "hi=bye", but doc.cookie never gets set. It remains an empty string for me. When I debug in FF, I see that the doc.cookie contains other cookie values and that new cookies can be set. Code: var text = this._createCookieString(name, value, !options.raw, options); doc.cookie = text; // even though text = "hi=bye", doc.cookie does not get updated with this value! return text; note: doc is defined for chrome - no exceptions are being thrown. The value just wont get set! |
|
Quick update:
I downloaded the YUI test files for the cookie utility and all the tests run fine in chrome. In production, if I try to use the feature that relies on the cookie utility, then this runs fine as well in chrome. Only when I try to run the tests locally does the test fail in chrome. So odd... but I'm glad it's working in production. |
| Page 1 of 1 | [ 6 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group