在这台服务器上找不到Jquery。 WordPress的

时间:2014-07-04 04:30:02

标签: jquery wordpress highcharts

我有两页events.php来自plugin1 来自index.php的{​​{1}}。 在events.php我包括jquery for ajax loading

plugin2

这个ajax加载工作正常。 从这个ajax调用我调用 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <a onclick="show_trend(<?php echo $event->output('#_EVENTID');?>)" >Trend</a> 并在index.php中呈现function。我正在做的是创建div。 为此,我包括

highchart

在index.php函数中。

但是我无法创建图表,因为jquery没有加载。在控制台中,我得到以下错误

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>

请帮帮我。

修改 正如 pr1nc3所建议的,我在我的函数

中做了以下事情

function em_bookings_events_table(){ ........ ....... ....... wp_enqueue_script( '的jquery');

}  add_action('wp_enqueue_scripts','em_bookings_events_table');

但现在jquery没有加载。

1 个答案:

答案 0 :(得分:2)

function em_bookings_events_table() {
   wp_enqueue_script('jquery');
   wp_enqueue_script('jquery-highcharts','http://code.highcharts.com/highcharts.js');
}
add_action( 'admin_enqueue_scripts', 'em_bookings_events_table' );

在functions.php中添加