[英]TypeError: jQuery(…).plugin-name is not a function
我的Wordpress網站上出現問題,某些JQuery元素已停止運行
主要與我們使用的音頻播放器插件有關。
TypeError: jQuery(...).audio1_html5 is not a function
isProgressInitialized:false
在Firebug中單擊時,它帶有:
<script>
jQuery(function() {
jQuery("#lbg_audio1_html5_25").audio1_html5({
skin:"whiteControllers",
initialVolume:1,
autoPlay:false,
loop:false,
playerPadding:5,
playerBg:"#000000",
bufferEmptyColor:"#929292",
bufferFullColor:"#454545",
seekbarColor:"#FFFFFF",
volumeOffColor:"#454545",
volumeOnColor:"#FFFFFF",
timerColor:"#FFFFFF",
songAuthorTitleColor:"#FFFFFF",
showRewindBut:true,
showPlayBut:true,
showPreviousBut:true,
showNextBut:true,
showPlaylistBut:true,
showVolumeBut:true,
showVolumeSliderBut:true,
showTimer:true,
showSeekBar:true,
showAuthor:true,
showTitle:true,
showPlaylist:true,
showPlaylistOnInit:true,
playlistTopPos:2,
playlistBgColor:"#000000",
playlistRecordBgOffColor:"#000000",
playlistRecordBgOnColor:"#333333",
playlistRecordBottomBorderOffColor:"#333333",
playlistRecordBottomBorderOnColor:"#FFFFFF",
playlistRecordTextOffColor:"#777777",
playlistRecordTextOnColor:"#FFFFFF",
numberOfThumbsPerScreen:5,
playlistPadding:4,
showPlaylistNumber:true,
isSliderInitialized:false,
isProgressInitialized:false
});
});
在我們的主頁上,Firebug中存在各種錯誤。 在我看來,JQuery尚未正確加載,但是我嘗試使用托管的Google和JQuery甚至最新版本,將JQuery鏈接放在頁眉中,放在頁腳中。
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
有任何想法嗎?
執行以下操作以正確加載wordpress的jquery,在模板header.php中將其添加到head部分(如果不存在)
<?php wp_enqueue_script("jquery"); ?>
<?php wp_head(); ?>
在wp_head函數之后,添加您的腳本
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
有關更多詳細說明,請訪問http://digwp.com/2009/06/ includes-jquery-in-wordpress-the-right-way /
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.