JavaScript的运行时错误:无法设置的未定义或为空引用属性“WebKit的” [英] JavaScript runtime error: Unable to set property 'WebKit' of undefined or null reference

查看:382
本文介绍了JavaScript的运行时错误:无法设置的未定义或为空引用属性“WebKit的”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对asp.net和前端的JavaScript当然工作。

I am working on asp.net and of course javascripts in front end.

我搜索在谷歌,但找不到关于WebKit的类似的问题,

I searched on Google but couldn't find the similar issue about "webkit",

顺便说一句,我使用的IE浏览器。我试图在Chrome调试,以及我的应用程序的一部分工作。我的意思是,启动页面可以加载,但没有更多的内容和细节出现。看起来它只是装框...

BTW, I am using IE. I tried to debug on chrome, well part of my app works. I mean, the start page can be loaded but no more content and details appear. Looks like it only loaded the frame...

我甚至尝试把一个断点在我的javascript code的开始,但这个错误仍然得到弹出。我猜是因为JS文件的?

I even tried put a breakpoint at the beginning of my javascript code but this error still got popped up. I guess because of the js file?

这是我使用。

<script src="Scripts/jquery-1.10.2.js"></script>
<script src="Scripts/jquery-ui-1.10.2.js"></script> 

这是一个奇怪的问题,它在上周出现又消失没有任何修饰!那么今天它再回来...

This is a weird issue that it appeared last week then disappeared without any modification! Then today it comes back again...

Thx提前!

推荐答案

它试图确定是否您使用的WebKit浏览器通过检查浏览器对象的WebKit的财产。不幸的是,在最近版本的jQuery被删除对象作为它的建议检查浏览器的功能,而不是浏览器类型。

It's trying to determine whether or not you're using a webkit browser by checking the webkit property of the browser object. Unfortunately, that object was removed in more recent versions of jQuery as it's recommended to check for browser features, rather than browser type.

这将摆脱错误信息,但将承担所有的浏览器都没有WebKit浏览器...

This will get rid of the error message, but will assume all browsers are not webkit browsers...

if (typeof ($.browser) == "undefined") {
    $.browser = {};
}
if (typeof ($.browser.webkit) == "undefined") {
    $.browser.webkit = false;
}

您将需要使用它的之后的jQuery是包括在内,但你打电话是造成错误之前什么。这可能就足以把它放在你自己的第一个包含的脚本的顶部。

You'll need it after jQuery is included, but before whatever you're calling that's causing the error. It will probably suffice to put it at the top of your own first included script.

这篇关于JavaScript的运行时错误:无法设置的未定义或为空引用属性“WebKit的”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆