Can't find a possible reason why something went wrong during javascript debugging

  • 2020-03-30 00:54:56
  • OfStack

Yesterday, when I was writing a very simple HTML page with some basic javascript script, I found that the script couldn't work. It took me over an hour to figure out where the error was. Simply give the following similar code and see if you can find the problem there.
< img SRC = "border = 0 / / files.jb51.net/file_images/article/201312/201312161731081.gif? 20131116173133 ">  
Look closely and see. It turns out that a semicolon was entered in Chinese mode, but in notepad the difference between the two semicolons is not obvious, especially if the code is long. If you say that the Chinese input method is not on, you will be finished. However, if the two alerts in the figure above require you to prompt in Chinese instead of English, it will inevitably require switching between Chinese and English input, so the potential risk is also increased.

So, the next time you can't find a possible problem in js, don't forget that it's probably caused by this annoying little problem. 'to'; The substitution of 'can solve the problem faster. I hope it will be helpful to you in the future.

Related articles: