JSFiddle - React, Tailwind, and code Playground

by bladnman

HTML

<script src="https://raw.github.com/carhartl/jquery-cookie/master/jquery.cookie.js"></script>
<input type=button id="theButton" value="run">

<div id="log" style="padding:10px; margin: 20px; border: 1px dotted #ccc; color:#888; font-face: arial; font-size:12px; background: #fbfbfb;"></div>

JavaScript

$("#theButton").live('click', function () {
   $("#log").append("------------------<br>"); 
    setCookie();
    readCookie();
    setCookieWithPath();
});

function setCookie() {
    $.cookie("no path", "no path");
}
function setCookieWithPath() {
    $.cookie("with path", "with path", { path: '/bogus' });
}



function readCookie() {
    $("#log").append("no path: " + $.cookie("no path") + "<br/>");
    $("#log").append("with path: " + $.cookie("with path") + "<br/>");

}