{"id":3666,"date":"2014-03-29T07:45:38","date_gmt":"2014-03-29T07:45:38","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/29\/jquery-session-problem-collection-of-common-programming-errors\/"},"modified":"2014-03-29T07:45:38","modified_gmt":"2014-03-29T07:45:38","slug":"jquery-session-problem-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/29\/jquery-session-problem-collection-of-common-programming-errors\/","title":{"rendered":"JQuery Session problem-Collection of common programming errors"},"content":{"rendered":"<p>By your example alone, you&#8217;re missing a reference to the required files, and you&#8217;re not wrapping your jQuery code in script tags. You need to reference not only jquery-source, but jquery-json, and jquery-session as well.<\/p>\n<pre><code> \n \n\n<\/code><\/pre>\n<p>Once you&#8217;ve got those in place, you need to place your logic within script tags:<\/p>\n<pre><code>\n$(function(){\n  $.session(\"foo\", \"bar\");\n});\n\n<\/code><\/pre>\n<p>See the following demo for an example: http:\/\/www.jaysalvat.com\/session\/test1.html<\/p>\n<p>Lastly, the <code>language<\/code> attribute of the <code>script<\/code> tag is deprecated. You can do away with it, but keep the <code>type<\/code> attribute.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By your example alone, you&#8217;re missing a reference to the required files, and you&#8217;re not wrapping your jQuery code in script tags. You need to reference not only jquery-source, but jquery-json, and jquery-session as well. Once you&#8217;ve got those in place, you need to place your logic within script tags: $(function(){ $.session(&#8220;foo&#8221;, &#8220;bar&#8221;); }); See [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3666","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3666","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3666"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3666\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3666"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}