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);
}
test ~ Jan 17, 2010 at 7:47 PM