$(\'.ajax\').click
(
function()
{
// If been bound then we need to return here.
alert(\':D\');
}
)
$(\'.ajax\').click
(
There's a really good way to do this in jQuery.
Here's an example.
function alertEvent() {
alert(":D");
}
$(".ajax").bind("click", alertEvent);
//When you want to ensure it won't happen twice...
$(".ajax").unbind("click", alertEvent);
$(".ajax").bind("click", alertEvent);
This method will only remove the event you specify, which makes it ideal for what you want to do.