[jQuery] Re: Cookies with JQuery?

2007-07-20 Thread Su

http://www.stilbuero.de/2006/09/17/cookie-plugin-for-jquery/

On 7/20/07, Danjojo [EMAIL PROTECTED] wrote:



Am I able to set client-side cookies with JQuery?

That would be REALLY great!! I could store the Language state in this
cookie.

$(function() {
$(#languages).bind('change', function() {
var country = $(this).val();
if(country) {
$('#countryFlag').attr(src, images/ + country
+ .gif);
}
});
});

Believe it or not I never got good or was able to write cookies in
javascript, they seemed incredibly overly-complex for my liking..
being an .asp hacker over the years *if* I needed state I would store
them in the Session object.




[jQuery] Re: Cookies with JQuery?

2007-07-20 Thread Danjojo

Got it using, Klaus's cookie plugin.

$(function() {
$(#languages).bind('change', function() {
var country = $(this).val();
if(country) {
$('#countryFlag').attr(src, images/ + country + 
.gif);
$.cookie('language', country); // set cookie
}
});
});

On Jul 20, 3:32 pm, Danjojo [EMAIL PROTECTED] wrote:
 Am I able to set client-side cookies with JQuery?

 That would be REALLY great!! I could store the Language state in this
 cookie.

 $(function() {
 $(#languages).bind('change', function() {
 var country = $(this).val();
 if(country) {
 $('#countryFlag').attr(src, images/ + country + 
 .gif);
 }
 });

 });

 Believe it or not I never got good or was able to write cookies in
 javascript, they seemed incredibly overly-complex for my liking..
 being an .asp hacker over the years *if* I needed state I would store
 them in the Session object.