Thursday, November 19, 2009

DataTable jQuery Plugin - JavaScript inside a table cell

If the data source is AJAX and the cell has JavaScript, the node is created and assigned directly via nTd.innerHTML=data so any JavaScript code inside the cell won't get executed. To correct than you need the custom fnRender for that column.

Labels:

Tuesday, October 27, 2009

jQuery form item highlighting

$(document).ready(function(){
  $("input,textarea,select")
    .focus(function() {$(this).addClass("form-item-focus");})
    .blur(function() {$(this).removeClass("form-item-focus");});
});

Labels:

Tuesday, September 22, 2009

Debugging jQuery selector

Selectors are really powerful, but how to you know what/which elements were chosen? Use this statement

Labels:

Friday, September 26, 2008

jQuery.com down or super slow

Anyone knows a downloadable documentation for jQuery. Their site is so slow that makes referencing impossible. This is an recurring issue that has happened for quite a few months. Is the traffic too much for them to handle?

Labels: ,

Thursday, September 25, 2008

jQuery not selecting nested elements

For a jQuery newbie, I was unsure how to only select the TR's of the main table and not TR's within sub-tables. Tried this that (children(), siblings()) and a bunch of selectors and found out the easy way ('#mytable > tbody > tr') How easy! :)

Labels:

Thursday, August 28, 2008

Check username availability via AJAX with jQuery

HTML JavaScript Server-side check.php

Labels: , ,

Friday, August 22, 2008

jQuery eq() typical mistake

With all the open/close quote, you might write this code:
var i = 123;
$(":checkbox:eq(i)").removeAttr("disabled");
Since the selector string is within the quotes, the correct statement should be:
$(":checkbox:eq("+i+")").removeAttr("disabled");

Labels: , ,