admin管理员组

文章数量:1406453

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

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=".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>

The above is included from a mon 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.

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

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

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

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

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./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>

The above is included from a mon 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.

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

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

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

Share asked Sep 7, 2012 at 18:46 SteveSteve 3,1053 gold badges29 silver badges48 bronze badges 3
  • do you get the same error if you ment out the reference to jquery-1.7.2.min.js? – karthikr Commented Sep 7, 2012 at 18:49
  • What are "the other scripts"? Are you loading a different library, such as MooTools? – Nix Commented Sep 7, 2012 at 18:50
  • 1 This error normally stems from loading more than 1 JQuery library. – Brant Commented Sep 7, 2012 at 18:51
Add a ment  | 

2 Answers 2

Reset to default 2

Try letting google host the script instead, also it is better to specify the MIME type 'text/javascript' when including the script.

<script src="http://ajax.googleapis./ajax/libs/jquery/1.8.1/jquery.min.js" type="text/javascript"></script>

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...

本文标签: javascriptjquery validate 181 quotjQueryquot is undefined error IE8Stack Overflow