3

I'm using the onclick attribute in Django HTML templates to dynamically set arguments to JavaScript function calls, like this:

<button onclick="activateSomething( argumentOne, {{ some_django_var }} )">Click Me</button>

VS Code's built-in embedded-scripts validation for HTML flags several syntax errors in such a construction, however, because it doesn't understand the Django template syntax. I could disable that validation, but that would be overkill, I still need the validation in other areas of my templates.

So the question is, is it currently possible to disable only specific JS errors, perhaps on a line-by-line basis à la # pylint: disable=some-error-type?

0

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.