diff --git a/sortt.js b/sortt.js index 2dda20c..5487e6f 100644 --- a/sortt.js +++ b/sortt.js @@ -8,10 +8,12 @@ */ -///////////////////////////////////////////////// -// Be sure you already have loaded jQuery !!! // -///////////////////////////////////////////////// +// test if jQuery is available +if(!window.jQuery) +{ + console.log("sortt.js: ERROR no jQuery found!"); +} else { //use JQuery to bind event on each with a "data-sortt" attribute $('th').each(function() { @@ -23,6 +25,7 @@ $('th').each(function() { }); }); +} //create global function with main routine window.sortt=function(normsort,revsort,isdefault){