Tag Archives: jquery

sessionStorage with expiry time

Session storage is a very handy tool for caching content fragments retrieved via AJAX. Once we’ve pulled the content once, and stuffed it into session storage, we can access it again quickly without the overhead of a round trip to the server. But what if we want to limit the age of that content, so that it expires before it gets too stale? Continue reading

facebooktwittergoogle_plusredditpinterestlinkedinmailfacebooktwittergoogle_plusredditpinterestlinkedinmail

Add custom JavaScript actions to WP e-Commerce cart updates, again

I previously wrote about adding your own custom JavaScript actions to the WP e-Commerce cart update event. Of course, things change, people change, hairstyles change, interest rates fluctuate, WP e-Commerce moves goalposts, so there is a new way to do this since version 3.8.11 came out. Continue reading

facebooktwittergoogle_plusredditpinterestlinkedinmailfacebooktwittergoogle_plusredditpinterestlinkedinmail

WooCommerce add to cart with quantity and AJAX

WooCommerce is a great e-commerce plugin for WordPress. It has some very nice basic features, but it’s also easy to customise and extend. On single product pages, you can add to cart with a quantity other than just one, and on the purchase page you can add to cart via AJAX without leaving the page. Wouldn’t it be nice to add to cart with both quantity and AJAX? Continue reading

facebooktwittergoogle_plusredditpinterestlinkedinmailfacebooktwittergoogle_plusredditpinterestlinkedinmail

Using jQuery’s ajaxSend event to change an AJAX request

Customisation of web software sometimes requires that you get it to pass around some additional information whenever it makes a page request. Often, putting that information into a cookie isn’t appropriate, so you try to squeeze it into the page query parameters, or form post data through hidden fields. But what if the software makes AJAX requests from jQuery? Luckily, jQuery can help you intercept AJAX requests so that you can customise them too. Continue reading

facebooktwittergoogle_plusredditpinterestlinkedinmailfacebooktwittergoogle_plusredditpinterestlinkedinmail

Autocomplete in WordPress plugin admin

I just had to find a way to add autocomplete to an admin screen for a WordPress plugin I’m writing. Although a few pieces of jQuery UI are bundled into the WordPress distribution, that doesn’t include jQuery UI autocomplete. But on the way to investigating how to drop that into my plugin, I discovered that WordPress does bundle in a similar, simpler plugin called jquery.suggest. Continue reading

facebooktwittergoogle_plusredditpinterestlinkedinmailfacebooktwittergoogle_plusredditpinterestlinkedinmail