I have an html code with jquery which is running without any error locally. But when I put that html code in word-press page (Thrive editor) I am getting too many errors. how can I resolve that ? In html I am using the following version of Jquery and datatables.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js" type="text/javascript"></script> <script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css"/>
The error in the console are the following
in wordpress you must change $ by jQuery
jQuery is inculded by adding the following before wp_head
<?php wp_enqueue_script('jquery'); ?>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.