Unable to initialize
Unable to initialize
cmoorerw7data
Posts: 7Questions: 1Answers: 0
I've created a table in HTML and added the two CDN references at the end as well as the Javascript command that identifies the table. However, none of the features show up on the page when I run it. I'm doing this inside a plugin that I've created in WordPress.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Can you post your code?
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.16/css/jquery.dataTables.css">
$(document).ready( function() ( $("#safelist_id").DataTable(); ) );Everything from
seems fine because the table looks good. The last three lines where I try to implement the DataTable code don't seem to do anything. The table just looks the same. This code is included in a PHP plugin.
Looks like you are missing the Datatables JS include. Try using the Download Builder to obtain the required files
Kevin
It looks like my code got all messed up on the comment because I didn't do the back tick thing. Let's give this a try. First I define the table and that works fine. After my second table tag, I do this...
I'm doing this inside a plugin that I wrote for my site which uses WordPress.WordPress
Ah - yes.
script
tags are weird like that. You need to use:John Resig (author of jQuery) wrote a great article about this way back in 2008, if you want more information.
Allan
No matter what I do I can't make the Data Tables features appear using the CDN code. I'm thinking of doing a local installation, but I'm not quite sure what all the steps are. I have the zip file in a local directory, but I'm not quite sure how to upload to the server. My site host is SiteGround and my CMS is WordPress.
I got the DataTables folder uploaded to my Home folder on cPanel but still no luck. It looks like the code just isn't executing for some reason. SiteGround claims that jQuery is installed but I just don't know at this point.
Can you link to the page where you are attempting to use the CDN and I'll take a look? Without being able to see even the code you are using, there isn't really much I can say as to what might be causing the issue.
Allan
Here is all the code on my WordPress page:
The table displays fine but there's no Data Table enhancement. There's nothing else on the page, no plugins, no images, nothing. My site host is SiteGround.
Your code snippet doesn't show jQuery being loaded. Are you loading jQuery?
Kevin
Being installed and being automatically accessed by your application are two different things. Ask SiteGround about it.
Voila. I was able to find a code snippet on the internet that showed me how to load jQuery. Here's the code after the table tag and it works.
All the features seem to be there so now I can try it on a bigger table.