简体   繁体   中英

JQuery error on wordpress page

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

  1. Uncaught TypeError: $.widget is not a function
  2. $.widget is not a function
  3. Uncaught TypeError: ThriveGlobal.$j(...).not(...).filter(...).mediaelementplayer is not a function
  4. Uncaught TypeError: b(...).not(...).filter(...).mediaelementplayer is not a function

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM