Jquery validate 1.8.1 "jQuery" is an undefined IE8 error

At the beginning - yes - jQuery is loaded before the validation plugin or any other js files.

Getting 'jQuery' undefined - jquery.validate-1.8.1.min.js line 13 character 1 in IE8. FF, Chrome, and Safari all have great form validation.

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

The above is included from the general header file. I have my actual validation rules on the page itself in another script block (but I also tried it in the header file in jquery and checked the script lock - not cubes on IE8.

If I continue to plow through the IE8 debugger, every time you click:

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

IE throws an "Expected Object" error message and points to "$"

+4
source share
2 answers

I found an error - the CDN calls were http: // and needed https: //. Although IE asked if I wanted to download potentially dangerous content, and I said yes, it never downloaded jQuery anyway. The moral of the story is do not believe in IE ...

+2
source

Try to allow the google script host, and it's also better to specify the MIME text type "text / javascript" when the script is included.

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

Source: https://habr.com/ru/post/1433026/


All Articles