dead simple jQuery progress bar plugin

by justin carlson on 05/13/2009
This snippet makes it easy to drop in basic horizontal bars, or progress reports.

     $('#sample').progressreport(100,50,'%1 (%3%) of goal reached.');

$(this) combo box selected options

by justin carlson on 05/13/2009
Simple jQuery snippet to get the selected options from a select box using $(this):
$(this).children(':selected').each(function() {
 // handle $(this) selected option
});

Passing Variables to Ajax Response Handler

by justin carlson on 11/28/2008
If you want to have one Ajax request handler for all your site's requests, or if you're just looking to pass a variable to the response handler, this snippet shows you how ridiculously easy it is. This snipped uses jQuery, but you can apply the same principle to any Ajax call.

Cancel JavaScript Event Bubbling

by justin carlson on 10/05/2008
This is some common sense that I had somehow misplaced.  How to cancel the bubbling of an event with html/js.

Simple isFloat() Function

by justin carlson on 01/01/2007
JavaScript does not provide an isFloat() function.

Here is a dead simple isFloat() example, this works well for most client side quick-checks.

I don't recommend doing client-side validation.


function isFloat(value){

   if(isNaN(value) || value.indexOf(".")<0){
     return false;
   } else {
      if(parseFloat(value)) {
              return true;
          } else {
              return false;
          }
   }
}