html5 - Can't get datatables.net working with javascript -
i'm been trying use datatables http://datatables.net/
trying getting work javascript. won't work me. when using example provided side, still work, blank page. know how work?
<script type="text/javascript" src="code.jquery.com/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="cdn.datatables.net/1.10.2/js/jquery.datatables.min.js"></script> <script> var dataset = [ ['trident', 'internet explorer 4.0', 'win 95+', '4', 'x'], ['trident', 'internet explorer 5.0', 'win 95+', '5', 'c'], ['trident', 'internet explorer 5.5', 'win 95+', '5.5', 'a'], ['trident', 'internet explorer 6', 'win 98+', '6', 'a'], ['trident', 'internet explorer 7', 'win xp sp2+', '7', 'a'], ['trident', 'aol browser (aol desktop)', 'win xp', '6', 'a'], ['gecko', 'firefox 1.0', 'win 98+ / osx.2+', '1.7', 'a'], ['gecko', 'firefox 1.5', 'win 98+ / osx.2+', '1.8', 'a'], ['gecko', 'firefox 2.0', 'win 98+ / osx.2+', '1.8', 'a'], ['gecko', 'firefox 3.0', 'win 2k+ / osx.3+', '1.9', 'a'], ['gecko', 'camino 1.0', 'osx.2+', '1.8', 'a'], ['gecko', 'camino 1.5', 'osx.3+', '1.8', 'a'], ['gecko', 'netscape 7.2', 'win 95+ / mac os 8.6-9.2', '1.7', 'a'], ['gecko', 'netscape browser 8', 'win 98se+', '1.7', 'a'], ['gecko', 'netscape navigator 9', 'win 98+ / osx.2+', '1.8', 'a'], ['gecko', 'mozilla 1.0', 'win 95+ / osx.1+', 1, 'a'], ['gecko', 'mozilla 1.1', 'win 95+ / osx.1+', 1.1, 'a'], ['gecko', 'mozilla 1.2', 'win 95+ / osx.1+', 1.2, 'a'], ['gecko', 'mozilla 1.3', 'win 95+ / osx.1+', 1.3, 'a'], ['gecko', 'mozilla 1.4', 'win 95+ / osx.1+', 1.4, 'a'], ['gecko', 'mozilla 1.5', 'win 95+ / osx.1+', 1.5, 'a'], ['gecko', 'mozilla 1.6', 'win 95+ / osx.1+', 1.6, 'a'], ['gecko', 'mozilla 1.7', 'win 98+ / osx.1+', 1.7, 'a'], ['gecko', 'mozilla 1.8', 'win 98+ / osx.1+', 1.8, 'a'], ['gecko', 'seamonkey 1.1', 'win 98+ / osx.2+', '1.8', 'a'], ['gecko', 'epiphany 2.20', 'gnome', '1.8', 'a'], ['webkit', 'safari 1.2', 'osx.3', '125.5', 'a'], ['webkit', 'safari 1.3', 'osx.3', '312.8', 'a'], ['webkit', 'safari 2.0', 'osx.4+', '419.3', 'a'], ['webkit', 'safari 3.0', 'osx.4+', '522.1', 'a'], ['webkit', 'omniweb 5.5', 'osx.4+', '420', 'a'], ['webkit', 'ipod touch / iphone', 'ipod', '420.1', 'a'], ['webkit', 's60', 's60', '413', 'a'], ['presto', 'opera 7.0', 'win 95+ / osx.1+', '-', 'a'], ['presto', 'opera 7.5', 'win 95+ / osx.2+', '-', 'a'], ['presto', 'opera 8.0', 'win 95+ / osx.2+', '-', 'a'], ['presto', 'opera 8.5', 'win 95+ / osx.2+', '-', 'a'], ['presto', 'opera 9.0', 'win 95+ / osx.3+', '-', 'a'], ['presto', 'opera 9.2', 'win 88+ / osx.3+', '-', 'a'], ['presto', 'opera 9.5', 'win 88+ / osx.3+', '-', 'a'], ['presto', 'opera wii', 'wii', '-', 'a'], ['presto', 'nokia n800', 'n800', '-', 'a'], ['presto', 'nintendo ds browser', 'nintendo ds', '8.5', 'c/a<sup>1</sup>'], ['khtml', 'konqureror 3.1', 'kde 3.1', '3.1', 'c'], ['khtml', 'konqureror 3.3', 'kde 3.3', '3.3', 'a'], ['khtml', 'konqureror 3.5', 'kde 3.5', '3.5', 'a'], ['tasman', 'internet explorer 4.5', 'mac os 8-9', '-', 'x'], ['tasman', 'internet explorer 5.1', 'mac os 7.6-9', '1', 'c'], ['tasman', 'internet explorer 5.2', 'mac os 8-x', '1', 'c'], ['misc', 'netfront 3.1', 'embedded devices', '-', 'c'], ['misc', 'netfront 3.4', 'embedded devices', '-', 'a'], ['misc', 'dillo 0.8', 'embedded devices', '-', 'x'], ['misc', 'links', 'text only', '-', 'x'], ['misc', 'lynx', 'text only', '-', 'x'], ['misc', 'ie mobile', 'windows mobile 6', '-', 'c'], ['misc', 'psp browser', 'psp', '-', 'c'], ['other browsers', 'all others', '-', '-', 'u'] ]; $(document).ready(function () { $('#demo').html('<table cellpadding="0" cellspacing="0" border="0" class="display" id="example"></table>'); $('#example').datatable({ "data": dataset, "columns": [ { "title": "engine" }, { "title": "browser" }, { "title": "platform" }, { "title": "version", "class": "center" }, { "title": "grade", "class": "center" } ] }); }); </script> </head> <body> <div id="demo"></div> </body> </html>
as always, thx bunch time,!
change script section:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="http://cdn.datatables.net/1.10.2/js/jquery.datatables.min.js"></script>
enjoy ;)
Comments
Post a Comment