我正在尝试将 Drupal 与 Picasa web integrator 结合起来。
我的 page.tpl.php 部分中有以下 3 行:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="/fotos/js/jquery.slimbox2/jquery.slimbox2.js" language="JavaScript"></script>
<script type="text/javascript" src="/fotos/js/jquery.pwi.js" language="JavaScript"></script>
我还在我的头部添加了这个脚本,以测试专辑(用户名和专辑名称并不重要,我用我的用户名和专辑离线测试了它,效果很好):
<script type="text/javascript">
$(document).ready(function() {
$("#container").pwi({
username: 'My',
maxresults: 5,
mode: 'album',
album: 'MyAlbum'
});
});
</script>
当我在 Drupal 页面上尝试时,Google Chrome 出现此错误:
prototype.js:5733Uncaught TypeError: Object#<Object> has no method 'dispatchEvent'
最佳答案
Drupal 还附带了 jQuery,您不能简单地在 <script>
中添加更高版本。标签。您可以尝试使用Drupal's jquery update要获取更新版本,或尝试 noConflict (我怀疑如果您想使用 Prototype,无论如何您都会需要它)。
关于javascript - 未捕获的类型错误 : Object#<Object> has no method 'dispatchEvent' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6331407/