On 16/09/06, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I made a cookie plugin and added it to SVN. Contrary to my latest mail
> regarding this I made the plugin in a more jQuery style, there's only
> one basic $.cookie function.
>
> Read a cookie: $.cookie('the_cookie');
>
> Set a cookie: $.cookie('the_cookie', 'the_value');
>
> Set a cookie with all available options:
> $.cookie('the_cookie', 'the_value', {expires: , path: '/', domain:
> 'jquery.com', secure: true});
>
> Delete a cookie: $.cookie('name', '', -1);
>
> Needs a little work on documentation but I'm too lazy now...
>
> Test page: http://stilbuero.de/jquery/cookie/
>
> Should I add $(...).cookie() to store the text (or maybe the value if
> there is one) of the first matched element?
>
>
> -- Klaus
>
Perhaps an option to define a date object for expires as well?
var myDate = new Date();
myDate.setTime(myDate.getTime() + 30 * 60 * 60 * 1000);
$.cookie('username', 'fred', {expires: myDate});
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/