I want to use DataTables for various functionalities for our tables. I am unable to fix the issue.
My code is:
<script type="text/javascript" src="<%=Constants.JSROOTURL%>jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/jquery.dataTables.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="//datatables.net/download/build/jquery.dataTables.nightly.js"></script>
<script type="text/javascript">
var jq = jQuery.noConflict();
jq(document).ready( function(){
jq("#results").dataTable();
});
</script>
Error says:
Uncaught TypeError: Object [object Object] has no method 'dataTable' imageValidation.html:234
(anonymous function) imageValidation.html:234
n jquery.min.js:2
o.fireWith jquery.min.js:2
e.extend.ready jquery.min.js:2
c.addEventListener.B
Any suggestions would be helpful.
Cut out the 1st 2 of your
scripttags (the comments are as an example, they should actually be deleted):You should not loading and reloading the libraries, that could screw things up…
Also it is not usually a good idea to use a nightly build of a plugin… could be buggy in production, just use
http://datatables.net/download/build/jquery.dataTables.js