Hi jQueriers  !

Please check a quick plugin which try to simulate session variables in
javascript (without ajax or cookies).

Source code.
http://code.google.com/p/jquery-session/

Demo:
http://jaysalvat.com/session/

Usage:
<script type="text/javascript">
$(function() {
    $.sessionStart();
    $.session("var1", "value1");
    $.session("var2", "value2");
    $.session("var3", "value3");
    $.sessionStop();
});
</script>

<script type="text/javascript">
$(function() {
    $.sessionStart();
    alert( $.session("var1") );
    alert( $.session("var2") );
    alert( $.session("var3") );
    $.sessionStop();
});
</script>

This is a quick piece of code but I think it could become useful with
some improvements.
Feedbacks are welcomed.

Known issues:
The real window.name is lost.
I wanted to load and save data on body load/unload and "rebuilt" the
original window.name but it doesn't work in my tests.

Important :
This plugin was inspired by the "window.name storage technic" uses in
qUIpt by Mario Heiderich.


Reply via email to