Re-binding jQuery Events on AJAX Callbacks

Posted by Jetlogs @ 1:48 pm
Category: jQuery,Web Development

Or the title can be put shortly as: Why doesn’t my jQuery events work after an AJAX callback?

Lets create a very simple example jQuery script which simply changes a list’s class on hover:

We’ll assign red as the hover color:

<style type="text/css">
.hover
{
	color: #f00;
}
</style>

Then add the jQuery hover() event to toggle/change the list’s class when the mouse hovers over the list. This is how the javascript code will look like inside the document.ready() function:

$("li").hover(
function()
{
	$(this).toggleClass("hover");
},
function()
{
	$(this).toggleClass("hover");
});

Read more »


jQuery: AJAX Tabs

Posted by Jetlogs @ 4:11 pm
Category: jQuery,Web Development

One of AJAX’s strengths is that it allows you to save bandwidth for your application by providing data on-demand instead of loading everything in one go. Because of this, some applications like the invisionboard has employed AJAX tabs on its user control panel. But have you ever wondered how to create one yourself? Well this article will show you how its done easily using jQuery. Read more »


Auto-saving with jQuery

Posted by Jetlogs @ 2:22 am
Category: jQuery,PHP,Web Development

Auto-saving has been one of the great features that AJAX has given to us. Ever had a time when you were writing a very long article and suddenly, your browser crashes. Thanks to applications that implement auto-saving, data is less prone from lost due to these cases.

Ever wondered how auto-saving is done? Basically, it is just a simple AJAX script running in the background at set intervals to save the data you are currently working on. Here is a simple tutorial on how to implement auto-saving using jQuery Read more »


jQuery: Auto-suggest with keyup() event

Posted by Jetlogs @ 4:59 pm
Category: jQuery

Due to a request from a friend, here is a tutorial on how to do an auto-suggest script using jQuery and the keyup() event. The program logic of this script is based on the AJAX suggest script from w3schools but with some improvements on the efficiency, ease of use and customization by using jQuery.

The basic logic of an auto-suggest script is that for every keystroke that a user enters on a textfield, the script must send an AJAX request and validate which words in a dictionary most closely resembles the current input. Read more »


jQuery: Textbox Validation and the blur() Event

Posted by Jetlogs @ 12:06 am
Category: jQuery,Web Development

Here is another jQuery tutorial demonstrating how to perform text validations using jQuery’s blur() event.

Its a fact that client-side client validation is no alternative to server-side validation especially in web applications. However, that doesn’t mean that we should drop client-side validation altogether. The truth is that client-side validation enhances a web application. First, the client-side validations provide a more responsive interface for users. Secondly, for a very large enterprise-grade application, shifting some of the validations on the client as a first pass filter will reduce the load on the server and improve its performance.

Now let’s move on to the tutorial. First of all, I’m going to use a simple registration form as an example for validation. Here is the demo for this tutorial:

Username: Username must be at least 4 characters in length

Password: Password must be at least 6 characters in length

Read more »


Next Page »
  • Archives

  • Donations

  • Social Bookmarks

  • Jetlogs.org
    Some Rights Reserved 2007
    Creative Commons License