[英]Jquery was not found on this server. Wordpress
我有两个页面events.php
从plugin1
index.php
从plugin2
。 在events.php中,我包括用于ajax加载的jQuery
<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>
此ajax负载工作正常。 从这个ajax调用中,我正在调用一个function
并在index.php中渲染一个div
。 我正在做的是创建highchart
。 为此,我包括
<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>
在index.php函数中。
但是我无法创建图表,因为jquery没有加载。 在控制台中,我收到以下错误
TypeError: $(...).highcharts is not a function
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>404.</b> <ins>That’s an error.</ins>
<p>The requested URL <code>/ajax/libs/jquery/1.8.2/jquery.min.js%20line%202%20%3E%20eval</code> was not found on this server. <ins>That’s all we know.</ins>
请帮我。
根据pr1nc3的建议进行编辑 ,我在函数中完成了以下操作
函数em_bookings_events_table(){........ ................ ....... wp_enqueue_script('jquery');
} add_action('wp_enqueue_scripts','em_bookings_events_table');
但是现在jquery没有加载。
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中添加它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.