IE 7兼容模式下的JQuery Unobtrusive验证导致“未找到成员”带有表单的页面出错 [英] JQuery Unobtrusive Validation in IE 7 Compatibility Mode causes "Member Not Found" Error in Page with Form

查看:106
本文介绍了IE 7兼容模式下的JQuery Unobtrusive验证导致“未找到成员”带有表单的页面出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我在Internet Explorer中查看我的网站时发现了一个JQuery错误。该错误是源自JQuery源的未找到成员错误。我注意到兼容模式按钮被点击 - 取消点击这修复了错误,但我无法假设我的网站用户会如此乐于助人。从那以后,我使用不同的兼容模式测试了我的网站,似乎无法摆脱这个错误。

Recently I noticed a JQuery error when viewing my site in Internet Explorer. The error is a "Member not found" error originating from the JQuery source. I noticed that the compatibility mode button was clicked-unclicking this fixed the error but I can't assume users of my site will be so obliging. Since then I have tested my site using the different compatibility modes and cannot seem to shake-off this error.

要重新创建错误,我将测试页面修剪为关注

To re-create the error I trimmed a test page to the following

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=IE7">
        <script src="/content/scripts/jquery-1.9.1.js"></script>
        <script src="/content/scripts/jquery.validate.js"></script>
        <script src="/content/scripts/jquery.validate.unobtrusive.js"></script>
        <title>IE Compatibility Test</title>
    </head>
    <body>
        <form>
        </form>
    </body>
</html>

注意:我使用的是JQuery Validation版本1.11.1和Microsoft JQuery Unobtrusive Validation版本2.0。当页面加载时,会发生未找到成员错误。我注意到删除表单标签会阻止错误发生。我也尝试过为表单提供名称和ID,但错误仍然存​​在。

Note: I am using JQuery Validation version 1.11.1 and Microsoft JQuery Unobtrusive Validation version 2.0. When the page loads the "Member not found" error occurs. I've noticed that removing the form tag stops the error from occuring. I've also tried providing the form with a name and id but the error still occurs.

我搜索过其他遇到此错误的人但发现没有相关内容。这让我相信我做错了什么。我想解决这个问题,因为我担心我网站的用户会在IE中选择兼容性视图而网站无法正常运行。

I have searched for this others experiencing this error but found nothing relevant. This leads me to believe that I am doing something wrong. I would like to get this problem fixed as I am concerned that a user of my site will select "Compatibility View" in IE and the site won't operate correctly.

什么是我缺少/有其他人遇到过这个错误?

What is it I am missing/has anyone else experienced this error?

推荐答案

您使用的是IE 10吗?如果是,则更改为兼容模式为IE 7或8是一个错误。

Are you using IE 10? If yes then changing to compatibility mode to IE 7 or 8 is a bug.

请参阅 JQuery Unobtrusive Validation Bug ticket#12577

使用以下元数据确保使用最新的渲染引擎

Use the following meta to ensure the latest rendering engine is used

<meta http-equiv="X-UA-Compatible" content="IE=edge">

这篇关于IE 7兼容模式下的JQuery Unobtrusive验证导致“未找到成员”带有表单的页面出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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