I want to embed external JavaScript placed in a folder in WordPress. if I enable the use of the script tag, it shows the "<" expected error below my code
global $wpdb; include("/asset/php/chart4php/inc/chartphp_dist.php"); $p = new chartphp(); $p->data_sql = $wpdb->get_results("select t2.name, count(t1.id) as score from custom_status as t2 left join wpsp_ticket as t1 on t2.name = t1.status group by t2.name"); $p->chart_type = "bar"; // Common Options $p->title = "Category Sales"; $p->xlabel = "Category"; $p->ylabel = "Sales"; $color = array("#1AAF5D","#F2C500","#F45B00","#8E0000","#0E948C"); $p->color = $color[rand(0,4)]; $out = $p->render('c1');
Tried to include js files
wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'ajax_search' ); wp_register_script( 'chartphp', plugins_url('/asset/php/chart4php/chartphp.js', __FILE__), array('jquery'));
wp_enqueue_script ('chartphp');
I also want to include 3 relocation files
<script src="/asset/php/chart4php/jquery.min.js"></script> <script src="/asset/php/chart4php/chartphp.js"></script> <link rel="stylesheet" href="/asset/php/chart4php/chartphp.css">

source share