[jQuery] Best way for storing user preferences?

[jQuery] Best way for storing user preferences?

Hi,
I've seen searching lately for a good way of storing preferences which a
jQuery script needs later on. The specific information the script needs
is the starting state of a <div> element (either open or closed). The
preferences are stored in a DB and sent from there somehow to the
browser. The "sent" and "storing" part is now the part I am searching for.
After searching around for a while I found several ideas/solutions. But
none seems to be perfect for me. So I wanted to ask you what is the best
way to do it:
1) Store the information in an invincible <div> at the end of the page.
And then parse this div. E.g:
<div id="prefs">
var1: value1;
var2: value2;
</div>
2) The js-script gets generated each time the page is called. And the
corresponding vars are set in there.
3) Every time the page is loaded the js-script asks the server for a XML
(or JSON) file with the preferences in there.
4) Write a XHTML DTD module in order to extend the div element with a
state-attribute. E.g:
<div state="closed">
5) More (and better) ideas?
To say is that those pages are often reloaded.
From my point of view 3) generates to much traffic on the net. 1) is
just a hack and therefor not really a good solution. I have my jQuery
scripts already in an external file. This way they can be cached by the
browser and don't have to be sent every time. So I don't really like 2)
either. Right now I would go with 4) unless someone has a better idea.
Does anybody have a better solution?
Raffael
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/