1

I have a SyntaxError in jquery.validate.min.js File

How I can solve it?

SyntaxError: Unexpected token < /ajax.aspnetcdn.com/ajax/jquery.validate/1.15.0/jquery.validate.min.js:1

4
  • what is the content of jquery.validate.min.js? Commented May 5, 2019 at 11:03
  • 1
    may be jquery.validate.min.js loaded incorrectly .inspect and see the content of this file from the source code (ctrl + u) Commented May 5, 2019 at 11:12
  • @Sohrab please past here the code, how are you using the .validate function rules? am guessing you put there an HTML tag Commented May 5, 2019 at 11:14
  • Thank you I solve my problem :) Commented May 8, 2019 at 8:50

2 Answers 2

1

The error is likely to mean that a .js file was fetched but an HTML was returned, probably because of an error 404 or similar. If you'd inspect the file that was fetched in the console (eg: in Chrome or Firefox, F12, then go to the network tab, then click on jquery.validate.min.js), you'll see some HTML content instead of the script for jquery.validate.min.js. Additionally that'd display the HTML of the error message from the server (404 page not found, 403 forbidden, etc).

You should check your connexion, check that your page has the sufficient authorizations to load content from ajax.aspnetcdn.com, and use https://ajax.aspnetcdn.com/... instead of /ajax.aspnetcdn.com/... in your script tag.

Sign up to request clarification or add additional context in comments.

1 Comment

@Sohrab glad to hear that :) ! Please note that, as surprising as it may seem, "thank you comments" should be avoided here (here's why) - if an answer is helpful, accept it by clicking on the checkmark. When you'll have 15 reputations, you'll also be able to upvote it.
0

Most of the time, the error SyntaxError: Unexpected token < is caused if the src of a script tag refers to file which was not found.

So, I recommend you to check the url of the script's src for validity.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.