jquery - how to get tablesorter to work if loading with getscript. -


i loading tablesorter using jquery .getscript.

woi_.loadeddatatables = false;  $.getscript("//cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.22.1/js/jquery.tablesorter.min.js").done(function(script, textstatus ){        console.log("text status " + textstatus);     woi_.loadeddatatables = true;      }).fail(function(jqxhr, settings, exception){        console.log(jqxhr);  }); 

later on have code checks if woi_.loadeddatatables true , calls sorttable if is.

woi_.functions.sorttable = function(el){      console.log(el);       el.tablesorter();  }  if(woi_.loadeddatatables){      woi_.functions.sorttable($("#userwidgetstats")); } 

my text status success, script has loaded, if check in resources panel can see has loaded.

console.log(el) gives me jquery element length of 1.

the table has structure seems tablesorter looking - thead , tbody, thead tr , multiple th elements, tbody multiple tr. @ rate if there problem table structure expect raise other error.

so seems tablesorter doesn't loaded getscript. right?


Comments

Popular posts from this blog

how to do line continuation in perl debugger for entering raw multi-line text (EOT)? -

javascript - Create websocket without connecting -

sharepoint - Accessing files across a shared directory using a Windows service -