JS check if jQuery is available
and dont trust the user ;)
This commit is contained in:
parent
f029789e11
commit
4e68338082
9
sortt.js
9
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 <th> with a "data-sortt" attribute
|
//use JQuery to bind event on each <th> with a "data-sortt" attribute
|
||||||
$('th').each(function() {
|
$('th').each(function() {
|
||||||
@ -23,6 +25,7 @@ $('th').each(function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//create global function with main routine
|
//create global function with main routine
|
||||||
window.sortt=function(normsort,revsort,isdefault){
|
window.sortt=function(normsort,revsort,isdefault){
|
||||||
|
Reference in New Issue
Block a user