Category: JavaScript

  • JavaScript: Easy Creation of “Countdown Timers”

    If there is one thing I don’t like doing – it’s doing the same thing twice or even more!  So I was building an application on the side where I need to have a listing that performs a simple countdown.  At this point I’ve been lazy and just have it counting down the seconds, but this example would be really easy to update to put a proper countdown of days, hours, minutes, and seconds – and heck if you get really adventurous even weeks, months, and years!

    (more…)

  • Maintaining the back button with AJAX

    When I blogged about whether or not you can use too much AJAX on your website.  The short answer was no; with one caveat being that you must not lose the user interaction experience.  In this scenario I’m referring to the back button.  If the user has “felt” like the content changed, they are likely to click the back button to return.  If they do this, it’s important for them to “go back” to where they “think” they were and not the last page that was loaded without AJAX and simply relying on Javascript events!  I’ve put together a quick example of how to do this. (more…)

  • Facebook Development – Quick and Easy Dialogs

    At my work, whenever we have a link to delete records, we always have a simple Javascript confirm dialog pop-up.  The confirm dialog just does the standard, “Are you sure you wish to delete this record?” with an OK and Cancel button.  If the user clicks cancel, the record is not deleted, if they click OK, the record will be deleted.

    If you’ve done some Facebook development, you will notice quickly that the alert() and confirm() functions do not work.  I’ve found this slightly annoying, so I’ve written a very simple Javascript function that let’s me use the nifty dialogs that Facebook provides us. (more…)

  • setTimeout() vs setInterval() in Javascript

    It feels like it has been a lifetime since my last blog!  I must apologize for the long delay, but between finding the time and finding a good topic to blog about, it’s being difficult.

    In today’s article, it’s been a while since I’ve needed to use either the setTimeout or setInterval functions and it seems many people are not familiar with the setInterval function.

    Let’s start by describing the two. (more…)

  • Jquery vs Prototype/Scriptaculous

    About two years ago I started learning AJAX and drag and drop.  The first project I applied it to was an existing project that was using Prototype and Scriptaculous.  So, I didn’t really have a choice as to what library I was going to use.

    Two years later, I do not know Jquery all that well, but I am absolutely falling in love with.  Doing things with Jquery seem to be 10 times easier to me.

    I always struggled with the each() function that I seemed to be constantly using with Prototype.  Jquery seems to understand this and simplify things for us.

    In this article, I’m going to describe my top reasons why I am becoming a Jquery lover over Prototype. (more…)