请有人可以帮助我解决此错误:
我正在尝试将社交储物柜脚本添加到我的wordpress网站上,并且收到此错误消息:
未捕获的TypeError:$(...)。sociallocker不是函数
这是代码:
$page_js = "
jQuery(function ($) {
'use strict';
blog.ItemDetails($);
jQuery(document).ready(function ($) {
$('#dst-social-lock').sociallocker({
url: '".get_the_permalink($product->id)."?utm_source=ShareButton',theme: 'flat',facebook:{
appId: '".get_option('dst-facebook-api')."',},twitter: {
tweet: {
text: 'Free download ".$product->title." by ".$user->username." on @blog #blog'
}
},text: {
message: 'Share and download this product free.'
},buttons:{
order: ['facebook-share','twitter-tweet','linkedin-share'],counters: false,lazy: true,localStorage: false,console: false
}
});
});
});
";
wp_add_inline_script('dst-script',$page_js);
预先感谢