I have a button in my html code to reset password that have nested quotes
<button type="" class="btn btn-primary" onclick="window.location.href='{% url 'password_reset' %}'">Forgot Password</button>
The button work on site and doesn't seem to have any problem so far. But my VS Code give me the following problem
';' expected.
Should I be concerned about this problem?
Technically no, since semicolons in javascript are used to seperate statements and there is only one line of code in this nested quote. There is also automatic semicolon insertion after every line therefore will still work when running. However, it is always encouraged to add semicolons after each statement to make the code easier to read and just simply look better. This can also ensures the consistency of the code incase JS wrongly interpert it.
But in this case, it is your choice to decide whether to add the semicolon or to ignore the warning. Try "window.location.href='{% url 'password_reset' %};'"
to fix the issue