jquery验证1.8.1“jQuery”未定义错误IE8 [英] jquery validate 1.8.1 "jQuery" is undefined error IE8

查看:301
本文介绍了jquery验证1.8.1“jQuery”未定义错误IE8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先关闭 - 是的 - 在验证插件或任何其他js文件之前加载jQuery。

First off - yes - jQuery is being loaded before the validate plugin or any other js files.

获取'jQuery'未定义 - jquery.validate-1.8。 1.min.js在IE8中第13行第1个字符。 FF,Chrome& Safari全部验证表格完美无缺。

Getting 'jQuery' is undefined - jquery.validate-1.8.1.min.js line 13 character 1 in IE8. FF, Chrome & Safari all validate the form perfectly fine.

<title>app title</title>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"></script>
<script src="path_to_file/jquery.validate-1.8.1.min.js"></script>
  // CSS and other scripts are here //
</head>
<body>

以上内容包含在公共头文件中。我在页面本身的不同脚本块中有我的实际验证规则(但我也在jquery下的头文件中尝试了它并验证脚本块 - 在IE8上没有骰子。

The above is included from a common header file. I have my actual validate rules on the page itself in a different script block (but I've also tried it in the header file under the jquery and validate script blocks - no dice on IE8.

如果我一直在通过IE8调试器,你可以随时点击:

If I keep plowing through the IE8 debugger, anytime you hit:

$(document).ready(function() {....

IE向调试器抛出一个关于预期的对象和点的错误到'$'

IE throws an error to the debugger about "Object expected" and points to '$'

推荐答案

我发现错误 - 对CDN的调用是http://并且需要是https:/ /。即使IE询问我是否想要加载可能不安全的内容,我说是的,它仍然没有真正加载jQuery。故事的士气 - 不要相信IE ...

I found the error - the calls to CDN were http:// and needed to be https://. Even though IE asked if I wanted to load the potentially unsafe content and I said yes, it still never actually loaded the jQuery. Morale of the story - don't believe IE...

这篇关于jquery验证1.8.1“jQuery”未定义错误IE8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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