Josh Knutson

Pondering Life Away

Check if jQuery is found on page

 
 

I was adding a feature to my debug and wanted to make it so I could init my application with a button click instead of opening up a new tab or initiating the current page.So to make sure my code would work anywhere and not throw an error I now put in the check to see if jQuery is found.

if (typeof jQuery == 'function') {
   jQuery('#reloadJax').live('click', function(event){
      var loadingText = '<span class="CFDdebugLoader">Loading..</span>';
      jQuery('#reloadJax').html(loadingText);
      $.get("#currentaddress#", function(data){
         jQuery('#reloadJax').text('AJAX Reinitialize');
      });
      event.preventDefault();
   });
   function addReload(){
      var vhtml = '<a id="reloadJax" class="CFDdebugButton ui-state-default ui-corner-all" title="AJAX Reinitialize" href="#currentaddress#">AJAX Reinitialize</a>';
      jQuery('#jaxReload').html(vhtml)
   };
   addLoadEvent(addReload);
}

A New Year A New Blog

 
 

I  finally moved over to mango blog and will be using html5 and css3

finally moving to mango blog

 
 
there will be some downtime as I finally move my blog over

coldfusion custom debug

 
 
my own coldBox inspired debug output
coldfusion Debug - josh style

check it out, I'll work on it occasionally
Older Topics