While checking a fully functional page with js (checked on the console), Chrome found an extra closing curly bracket in ... meta charset. And because of this, now nothing works. Tell me what to do? ...

By request: 1) Before the meta charset comes only <!DOCTYPE HTML> . 2) The js file call was removed, but the error remained.

Things got even worse. Now the error is ALWAYS in the second line, whatever it is. !!!

  • Perhaps, before the <meta charset> script is included, and in it an extra closing bracket? - Vesper
  • Add information that came before the <meta> tag - Aleksander K.
  • Add to the question everything that is out of the body , as well as write the name of the file, there is a suspicion that he, js - FLCL
  • Chromium is known for occasionally correcting minor errors. I recommend to download this page by curl or wget and look at the contents of the file. - KoVadim

3 answers 3

You can not look at the top of the document and look for a problem. From experience I will say that you have an error in the js code that is in the body of the document. If you do not have a lot of code, search problems should not arise. You can set breakpoints in the debugger, or you can cut the code. This is not the only cant chrome. It happens that it does not display the js code in the body of the document and you have to reload the page.

    The answer turned out to be simple: the fact is that third-party code was called on the page using AJAX, and there was a button that had the effect of getting the value of one input field — the problem was solved by moving the function from the called file to the caller.

      You somehow slip the html page as js.

      It is worth checking the addresses of the connected scripts and the absence of ajax-requests, obviously waiting for js, or receiving the current page with the content-type text / javascript or application / javascript.