请高手帮我看看这段代码哪里有错怎么修改 35

我的浏览器上面提示行:11字符:7错误:例外被抛出且未被接住什么原因,怎么解决,我对js不太懂,找不出.Scriptaculous={Version:'1.5_pre1'... 我的浏览器上面 提示行:11 字符:7 错误:例外被抛出且未被接住 什么原因,怎么解决,我对js不太懂,找不出.

Scriptaculous = {
Version: '1.5_pre1',
require: function(libraryName) {
// inserting via DOM fails in Safari 2.0, so brute force approach
document.write('<script type="text/javascript" src="'+libraryName+'"></script>');
},
load: function() {
// fixme: check for prototype version number
if(typeof Prototype=='undefined')
throw("script.aculo.us requires the Prototype JavaScript framework >= 1.4.0");
var scriptTags = document.getElementsByTagName("script");
for(var i=0;i<scriptTags.length;i++) {
if(scriptTags[i].src && scriptTags[i].src.match(/scriptaculous\.js$/)) {
var path = scriptTags[i].src.replace(/scriptaculous\.js$/,'');
this.require(path + 'util.js');
this.require(path + 'effects.js');
this.require(path + 'dragdrop.js');
this.require(path + 'controls.js');
}
}
}
}

Scriptaculous.load();
我也清楚,这是以前别人做的网页,我维护的,我把这段代码删了网页就不报错了,请你帮忙看看哪里错了
展开
 我来答
百度网友9685a44
2010-01-13 · TA获得超过576个赞
知道小有建树答主
回答量:223
采纳率:0%
帮助的人:201万
展开全部
你把代码删了当然不报错啦,呵呵。
是因为你没有载入prototype.js,所以Prototype未定义,就抛出异常。
if(typeof Prototype == 'undefined')//检测是否定义了Prototype
throw("script.aculo.us requires the Prototype JavaScript framework >= 1.4.0");//如果未定义就抛出异常。

你在<script>前面加上<script src="prototype的路径"></script>来引入Prototype.js这个文件就行了。
chenzhiqing200
2010-01-09 · TA获得超过102个赞
知道答主
回答量:542
采纳率:0%
帮助的人:0
展开全部
typeof Prototype这句怎么理解?
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式