When developing with SPRINGMVC, the following code cannot be executed. And I have correctly imported the jquery framework.
< script type = "Text/javascript" > $ ( function () {alert ( " hello " </ script >
Clearly remember before it can be executed why now can't. In the browser development This tool can only see syntaxerror:expected expression, got ' < '[Learn more] this error.
Read a lot of articles on the Internet, I have tried various methods or can not solve. It took a whole day. In the end I used the stupidest way. Since it was possible to do it before then because I modified some place to cause it could not be executed. I'll just have to find the two adjacent versions that can be executed to be non-executable, comparing the two versions. You can find out what is causing the problem.
So I used a dichotomy from my 400 versions of the code. Check out the code, run, and then check out the run (really too laborious), the cost of Dickens finally found. These two adjacent versions have only one letter difference.
This is the previous version
This is the latter version.
The truth, because before the landing function, too often need to log on to do the test, so the interception of all requests for this setting casually added a letter up, become only to intercept the non-existent request, it is equivalent to all the requests are not intercepted. So my jquery framework source code was not intercepted. The jquery code I posted above can be run at this point . later I changed it to intercept all requests (however, I didn't know from now on that the jquery code I posted above was no longer working). So I have been developing more than 200 versions later. At this point, I finally realized that the article I saw before was that Ajax could not be executed because the static resources were intercepted (at that time I did not believe that the static resources were intercepted because I have no Ajax).
So, when you know the cause of the problem, everything can be solved. Problems that do not know the cause of the problem are the hardest to solve. In order to solve the problem, we searched for articles that do not intercept static resources. It's not bad to find an article here.
This is the original link https://www.cnblogs.com/wyb628/p/6813985.html
I put the article down.
One
Two
Resolves an issue where SPRINGMVC interceptors intercept static resources.