The JavaScript blog.


HTML cookies angularjs dm

ngKookies, preCode.js

Posted on .


ngKookies (GitHub: voronianski/ngKookies, License: MIT, npm: ngkookies) by Dmitri Voronianski is a replacement for the Angular $cookieStore provider. It's a port of jquery-cookie that helps work around angular.js issue 950.

After loading it, you can set cookies with $kookies.set('name', 'value') and read them with $kookies.get. You can also delete cookies with $kookies.remove.

Each method accepts an options object that can include the path and expires arguments. You can also store JSON objects as cookies with $kookiesProvider.config.json = true.


Have you ever written a blog engine or CMS that has to display source code? If so you've probably run into the issue where human-readable HTML doesn't work well with pre elements if initial indentation is included.

preCode.js (License: MIT) Leon Sorokin is a small script that finds <pre><code> blocks and strips the leading and proceeding whitespace, so syntax highlighters should be able to display code properly.

It's written using the standard DOM API, so it shouldn't need any dependencies. It'll also fix whitespace in textarea as well.


jquery jqueryui cookies timers

jQuery Roundup: cookieConsent, Timing, Tagit

Posted on .

Note: You can send your plugins and articles in for review through our contact form or @dailyjs.


The EU doesn't understand cookies

jquery.cookieConsent (License: MIT) by Tom Ashworth is a drop-in plugin for satisfying new EU policies regarding cookies. By running $.cookieConsent(), this plugin will display a banner. Once the banner is clicked, a cookie called cookieConsent will be set so the banner won't need to annoy the visitor again.

The irony of setting a cookie to hide a message informing users about the use of cookies is amusing, but that's not Tom's fault so much as the nature of the beast.


Timing (GitHub: creativecouple / jquery-timing, License: MIT) by Peter Liske is a wrapper around setTimeout and other timer functions. It has a chainable API, so it's easy to create complex scenarios without too much code:



Tagit (GitHub: hailwood / jQuery-Tagit, License: CC BY-SA 3.0) by Matthew Hailwood uses jQuery UI's Autocomplete to present an alternative way of entering lists. Features include:

  • Automatically adding partially typed tags if the control loses focus
  • Friendly behaviour when deleting tags
  • Sortable items using drag and drop

The sortable version only requires a single option to work:

$(selector).tagit({ tagSource: ['one', 'two', 'three'], sortable: 'handle' });

It's quite easy to theme this plugin, and the author has kindly bundled quite a few CSS files.


jquery plugins css cookies

jQuery Roundup: StyleDocco, noUiSlider, jecookie

Posted on .

Note: You can send your plugins and articles in for review through our contact form or @dailyjs.


&#95;&#95;&#95;&#95;&#95;&#95;&#95; __         __        &#95;&#95;&#95;&#95;&#95;
|     __|  |_.--.--|  |