簡體   English   中英

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

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

我有兩個頁面events.phpplugin1 index.phpplugin2 在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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM