我有一个正在加载的 jQuery 脚本,但是当我通过 PHP 加载时,我收到了这个错误:
Uncaught TypeError: Object [object Object] has no method 'facebookTrafficPop'
当我通过 Chrome Developer consule 查看时,我可以看到它抱怨的那一行:
jQuery().facebookTrafficPop({
这是我在 PHP 中的代码:
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery().facebookTrafficPop({
title: '<?php echo $params->get('title', 'Facebook Like Us Popup'); ?>',
message: '<?php echo $params->get('message', ''); ?>',
url: '<?php echo $params->get('url', $url); ?>',
showfaces: <?php echo $params->get('showfaces', '1'); ?>,
timeout: '<?php echo $params->get('timeout', '60'); ?>',
delay: '<?php echo $params->get('delay', '0'); ?>',
closeable: <?php echo $params->get('closeable', '1'); ?>,
advancedClose: <?php echo $params->get('advancedClose', '1'); ?>,
wait: '<?php echo $params->get('wait', '0'); ?>',
//lang: '<?php echo $params->get('lang', 'en'); ?>',
lang: '<?php echo $lang->getTag(); ?>',
opacity: '<?php echo $params->get('opacity', '25'); ?>'
});
});
</script>
这就是我在 chrome 中看到的:
<script type="text/javascript">
//<script type="text/javascript" language="javascript">
// jQuery.noConflict();
jQuery(document).ready(function(){
jQuery().facebookTrafficPop({
**Uncaught TypeError: Object [object Object] has no method 'facebookTrafficPop'**
title: 'Facebook Like Us Popup',
message: '',
url: 'https://www.facebook.com/Arab.Dentist.Network',
showfaces: 1,
timeout: '60',
delay: '0',
closeable: 0,
advancedClose: 0,
wait: '0',
//lang: 'en',
lang: 'en-GB',
opacity: '25'
});
});
</script>
如果您能帮助解决这个问题,请告诉我。