的ReferenceError:找不到变量:ValidatorEnable在Safari [英] ReferenceError: Can't find variable: ValidatorEnable in Safari

查看:295
本文介绍了的ReferenceError:找不到变量:ValidatorEnable在Safari的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个ASP.NET应用程序,包括JavaScript动态启用或禁用页面上的验证。 ASP.NET中存在被设置有包括用于此目的的JavaScript功能,如ValidatorEnable()该应用一个网络资源。当我在Mac上运行我们在Safari上的应用程序,我得到的错误,它无法找到ValidatorEnable。这是我们在jQuery的(文件)。就绪()回调函数调用的函数,因此期望的是,所有的资源都可以在这一点上。在调试器检查揭示了资源未曾被传递到客户端浏览器。

有没有人见过这样的事情之前?在IE浏览器,浏览器,或Firefox不会出现在Windows上的问题,也不会出现在Mac上的Chrome或Firefox。的Safari似乎是不正确接收或处理的ASP.NET的JavaScript验证功能之一。

在此先感谢!


解决方案

我已经发布了<一个href=\"http://www.brillianceweb.com/blog/article/69/aspnet-20-misidentifies-safari-71-on-ios-and-os-x\"相对=nofollow>关于为ASP.NET 2.0浏览器识别功能的博客文章。基本上,在浏览器版本字符串铬7.1开始碰撞。 Asp.Net认为你正在运行的Safari浏览器的旧版本不支持JavaScript的最近。通过改变&LT;的browserCaps方式&gt; 你的web.config的元素,可以搭配较新的版本,并指定正确的能力。

\r
\r

&LT;结构&gt;\r
  &LT;&的System.Web GT;\r
    &LT;&的browserCaps GT;\r
      &所述;滤光器&gt;\r
        &LT;大小写匹配=为AppleWebKit / 600&GT; EcmaScriptVersion = 1.5\r
          supportsCallback =真\r
        &LT; /箱&GT;\r
        &LT;大小写匹配=为AppleWebKit / 601&GT; EcmaScriptVersion = 1.5\r
          supportsCallback =真\r
        &LT; /箱&GT;\r
        &LT;! - 投机futureproofing能做到这一点?\r
        &LT;大小写匹配=为AppleWebKit / 602&GT; EcmaScriptVersion = 1.5\r
          supportsCallback =真\r
        &LT; /箱&GT;\r
        &LT;大小写匹配=为AppleWebKit / 603&GT; EcmaScriptVersion = 1.5\r
          supportsCallback =真\r
        &LT; /箱&GT;\r
        &LT;大小写匹配=为AppleWebKit / 610&GT; EcmaScriptVersion = 1.5\r
          supportsCallback =真\r
        &LT; /箱&GT;\r
        &LT;大小写匹配=为AppleWebKit / 650&GT; EcmaScriptVersion = 1.5\r
          supportsCallback =真\r
        &LT; /箱&GT;\r
         - &GT;\r
      &LT; /滤光器&gt;\r
    &LT; /&的browserCaps GT;\r
  &LT; /system.web>\r
&LT; /结构&gt;

\r

\r
\r

有<一个href=\"http://stackoverflow.com/questions/25978746/ios-8-safari-8-not-working-with-asp-net-ajax-extensions\">other修复它的方法。

I am working on an ASP.NET application that includes JavaScript to dynamically enable or disable validators on the page. In ASP.NET there is a web resource that is provided with the app that includes JavaScript functions for this purpose, such as ValidatorEnable(). When I run our application on Safari on a Mac, I am getting the error that it cannot find ValidatorEnable. This is a function we are calling in the jQuery(document).ready() callback function, so the expectation is that all resources are available at this point. Inspecting in the debugger reveals that the resource was never delivered to the client browser.

Has anyone seen something like this before? This problem does not occur on IE, Chrome, or Firefox on Windows, nor does it occur on Chrome or Firefox on the Mac. Safari seems to be the one that is not correctly receiving or processing the ASP.NET JavaScript validator functions.

Thanks in advance!

解决方案

I've posted a blog post regarding the browser identification function for ASP.NET 2.0. Basically, there is a collision in the browser version string for chrome starting in 7.1. Asp.Net believes that you are running an older version of Safari Browser that doesn't support recent javascript. By changing the <browserCaps> element of your web.config, you can match the newer version and assign the correct capabilities.

<configuration>   
  <system.web>     
    <browserCaps>       
      <filter>
        <case match="AppleWebKit/600">EcmaScriptVersion = 1.5           
          supportsCallback = true         
        </case>       
        <case match="AppleWebKit/601">EcmaScriptVersion = 1.5           
          supportsCallback = true         
        </case>       
        <!-- Speculative futureproofing could do this?
        <case match="AppleWebKit/602">EcmaScriptVersion = 1.5           
          supportsCallback = true         
        </case>       
        <case match="AppleWebKit/603">EcmaScriptVersion = 1.5           
          supportsCallback = true         
        </case>       
        <case match="AppleWebKit/610">EcmaScriptVersion = 1.5           
          supportsCallback = true         
        </case>       
        <case match="AppleWebKit/650">EcmaScriptVersion = 1.5           
          supportsCallback = true         
        </case>       
        -->
      </filter>     
    </browserCaps>   
  </system.web>
</configuration>

There are other methods of fixing it.

这篇关于的ReferenceError:找不到变量:ValidatorEnable在Safari的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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