jQuery session with jquery-json
Hi all,
I'm quite new to jQuery and I want to use one plugin, the jquery-json:
http://code.google.com/p/jquery-json/
I'm attaching the js like this:
<script type="text/javascript" src="jquery.json-1.3.js"></script>
And after that I'm doing the code below:
-
myfun = function(){
var thing = {plugin: 'jquery-json', version: 1.3};
var encoded = $.toJSON(thing); //'{"plugin": "jquery-json", "version": 1.3}'
var name = $.evalJSON(encoded).plugin; //"jquery-json"
var version = $.evalJSON(encoded).version; // 1.3
function setSession(name, value) {
$.session(name, value);
}
setSession('var1', "somevalue");
}
but I get the following errors:
jQuery is not defined
$.evalJSON is not a function
Please give some help, I need var1 value into the session. Later I will need to put it in an iframe and the value has to be available outside the iframe.. that's why I'm using the session plugin.
Thanks a ton in advance!