小编3ho*_*ugh的帖子

处理jQuery(document).ready中的错误

我正在开发用于Web框架的JS,并经常与其他开发人员(通常容易出错)的jQuery代码混合使用.不幸的是,他们的jQuery(文档).ready块中的错误阻止了我的执行.采取以下简单示例:

<script type="text/javascript">
    jQuery(document).ready(function() {
        nosuchobject.fakemethod();       //intentionally cause major error
    });
</script>
<script type="text/javascript">
    jQuery(document).ready(function() {
        alert("Hello!");                 //never executed
    });
</script>
Run Code Online (Sandbox Code Playgroud)

不管先前发生了什么,第二个就绪块不应该执行吗?是否有一种"安全"的方式来运行jQuery(document).ready即使出现以前的错误也会运行?

编辑:由于它们是由其他作者编写并且是任意混合的,因此我无法控制/查看容易出错的块.

javascript jquery

14
推荐指数
1
解决办法
1万
查看次数

YouTube数据API - "超出服务限额"

在过去的24小时内,我们有大量的TubePress用户报告来自YouTube的错误消息:

Serving Limit Exceeded
Run Code Online (Sandbox Code Playgroud)

我们的大多数用户都拥有自己的Google API密钥,而我们的云托管TubePress安装并不能达到每日配额.我找不到有关此特定错误消息的任何文档,也无法理解为什么它会突然出现在这么多具有​​不同密钥的网站上.

谁能解释一下发生了什么?

youtube-api

8
推荐指数
1
解决办法
2298
查看次数

YouTube iframe嵌入在Internet Explorer 8中抛出JavaScript错误

在Internet Explorer 8中查看时,似乎简单的YouTube iframe嵌入会抛出JavaScript错误.希望有人能找到我做错的内容 - 除非这是一个新错误?

如何重现:

  1. 打开Internet Explorer 8并按F12打开开发人员工具
  2. 切换到"控制台"选项卡以查看JavaScript控制台
  3. 访问http://ehough.com/ie8-youtube.html,这是一个直接从youtube.com复制的iframe嵌入,并查看JavaScript错误

错误:

SCRIPT5007: Unable to get value of the property 'getActivated': object is null or undefined 
ie8-youtube.html, line 28 character 128

SCRIPT5020: Expected ')' in regular expression 
html5player-vflR_cX32.js, line 675 character 708

SCRIPT438: Object doesn't support property or method 'SetReturnValue' 
www-embed-vflqDUnF8.js, line 66 character 56

SCRIPT438: Object doesn't support property or method 'SetReturnValue' 
uVlr4eYkNjY, line 1 character 1
Run Code Online (Sandbox Code Playgroud)

有人对此有任何见解吗?

html javascript youtube youtube-api

7
推荐指数
1
解决办法
5170
查看次数

标签 统计

javascript ×2

youtube-api ×2

html ×1

jquery ×1

youtube ×1