Archive image

Posts Tagged ‘jquery’

Promises with jQuery

Promises are starting to change the way we write asynchronous JavaScript. They allow us to write clearer, shorter callbacks and to separate application logic from DOM interaction.

jQuery’s implementation of the Promise pattern (introduced in version 1.5) centres around the Deferred object , the predominate use of which is to attach success and failure callbacks to AJAX requests.

Read more…

Simple AJAX Unit Converter

I’ve been doing quite a bit with jQuery and AJAX as of late and have not only been impressed at the ease of implementation, but also the snappy and responsive feel that it brings to your web apps.

To demonstrate this I’m going to show you how to make a simple unit converter, which will allow you to convert units of digital storage without having to make a single page refresh.

Here’s a demo of what we’ll end up with.

Read more…

Sliding panels with jQuery

Sliding panels are cool! jQuery is cool! Who doesn’t love sliding panels and jQuery??

This tutorial aims to show you how to build a menu, where the various items respond to a user click by sliding a panel into view containing relevant content.

Here’s a demo of what we’ll end up with.

Read more…

Using cookies with jQuery to make a simple style switcher

Short for HyperText Transfer Protocol, HTTP is the underlying protocol of the World Wide Web. It is used when a browser requests a web page from a server and it is used when the server responds to the browser’s request. HTTP is great, but it is also stateless, which means that once a server has sent a page to a browser, it forgets having done so straight away. This can be a problem, for example, if a user has identified themselves in order to access protected pages, or if a user wants to customize some aspect of a website, as the server simply cannot remember a thing about it!

Sounds like a job for cookies!

Read more…

Making Lightbox work in IE9

I’m a big fan of Lokesh Dhakar’s Lightbox script, which is an elegant and easy to use method of displaying images against a darkened background on a web page. I’ve used this script quite heavily in the past, so I was somewhat alarmed when reviewing some of my old projects, to observe that it was broken in Internet Explorer 9.

Read more…

Tooltips using jQuery, aToolTip and regular expressions

Imagine you have a page of text and you want each occurrence of a certain word to display a tooltip whenever a visitor hovers over it with their mouse. What’s the best way to go about implementing this? Well, you could edit your HTML by hand and add the appropriate tags to every single occurrence of the term. Or, you could just specify your term once and then let jQuery do the work for you.

Read more…

Tampermonkey Tutorial

In an effort to stay abreast of developments on the World Wide Web, I subscribe to the CodeProject’s excellent newsletter: The Daily Insider. Now, when I open this newsletter in my browser, I’m presented with a whole bunch of links (usually 12) that I want to open. It was getting a bit bothersome to open all of these manually, so I decided to write a userscript to do it for me.

Read more…

Arrow pointing to the left Newer Entries