Use jQuery's IsNumeric method.
http://api.jquery.com/jQuery.isNumeric/
if ($.isNumeric(id)) {
//it's numeric
}
CORRECTION: that would not ensure an integer. This would:
if ( (id+"").match(/^\d+$/) ) {
//it's all digits
}
That, of course, doesn't use jQuery, but I assume jQuery isn't actually mandatory as long as the solution works