Issue getting jQuery Data-tables to work

131
February 09, 2018, at 07:39 AM

I was tryin to create something quick to use data tables but I am having issues with jQuery I keep getting jQuery undefined and $ undefined. I thought I had put jQuery in the correct order. I am little stumped on what to do. I know it something simple so I will continue to figure it out.

Index.php

<div class="container">
            <h1>Example List</h1>
            <table class="table">
            <thead>
            <tr>
            <th>Date</th>
            <th>Equipment</th>
            <th>Qty</th>
            </tr>
            </thead>
            <tbody>
            <?php 
           <?php 
                $db = new PDO('mysql:host=localhost;dbname=database;charset=utf8mb4', 'user', 'password');
                 $stmt = $db->query('SELECT * FROM table');
                     while($row = $stmt->fetch(PDO::FETCH_ASSOC)) 
            { ?>
            <tr>
            <td><?php echo $row['date'];?></td>
            <td><?php echo $row['equipment'];?></td>
            <td><?php echo $row['qty'];?></td>
            </tr>
            <?php } ?>
            </tbody>
            </table>
     </div>
            <?php //script section ?>
            <link rel="stylesheet" href="bootstrap.min.css">           
            <scriptsrc="jquery.js"></script>
            <script src="jquery.dataTables.min.js"></script>
            <script>
                 $('.table').DataTable();
            </script>
Answer 1

Going for the low hanging apple here, but is <script src="jquery.js"></script> present as-is in your index? Seems to be a typing error.

READ ALSO
Image and Video Slider Autoplay

Image and Video Slider Autoplay

Im using bxslider to show images and videos on a slider and i need that the slider show images every 5 seconds but when a video appears, the video autoplay until the endThen, show the next slide

149
Datatables language error

Datatables language error

I'm trying to use a language json file in Datatables but I always get a strange error in consoleIf I write

122
jquery-timepicker-rails not loading in Rails 5.1.2

jquery-timepicker-rails not loading in Rails 5.1.2

I'm upgrading a Rails 32 app to 5

140
How to insert attributes into a WFS using OpenLayers 3?

How to insert attributes into a WFS using OpenLayers 3?

So I have a web app that's running and is able to add polygon to existing Postgis tables by getting data from GeoserverI need the following one specific bit of functionality added:

161