Created
October 1, 2020 01:42
-
-
Save cryocaustik/595eb87f4b64abee025317d68b1005df to your computer and use it in GitHub Desktop.
force data tables onto html table in any site
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inject jquery | |
var jq = document.createElement('script'); | |
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
// inject data tables | |
var dt = document.createElement('script'); | |
dt.src = "//cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(dt); | |
var dtcss = document.createElement('link'); | |
dtcss.src = "//cdn.datatables.net/1.10.22/css/jquery.dataTables.min.css"; | |
document.getElementsByTagName('head')[0].appendChild(dtcss); | |
// initiate data table | |
$('.domain-record-table').DataTable(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment