简体   繁体   English

在此服务器上找不到jQuery。 WordPress的

[英]Jquery was not found on this server. Wordpress

i have two pages events.php from plugin1 index.php from plugin2 . 我有两个页面events.phpplugin1 index.phpplugin2 in events.php i am including jquery for ajax loading 在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>

this ajax load works fine. 此ajax负载工作正常。 from this ajax calling i am calling a function and rendering a div in index.php. 从这个ajax调用中,我正在调用一个function并在index.php中渲染一个div what i am doing is creating highchart . 我正在做的是创建highchart for this i am including 为此,我包括

<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>

in index.php function. 在index.php函数中。

but i am not able create charts beacuse jquery is not loading. 但是我无法创建图表,因为jquery没有加载。 in console, i am gettin the following error 在控制台中,我收到以下错误

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>

please help me. 请帮我。

Edit as suggested by pr1nc3 i have done the following thing in my function 根据pr1nc3的建议进行编辑 ,我在函数中完成了以下操作

function em_bookings_events_table() { ........ ....... ....... wp_enqueue_script('jquery'); 函数em_bookings_events_table(){........ ................ ....... wp_enqueue_script('jquery');

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

but now jquery is not loading. 但是现在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' );

add this in functions.php 在functions.php中添加它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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