简体   繁体   中英

Inline javascript in flask jinja2 templates not showing up in firefox/chrome debugger

I'm taking over a flask project where the previous dev wrote quite a bit of their javascript/jquery in inline script tags in template files instead of separate js files in a static folder.

There's an issue with table cell highlight occuring after a long delay and I can't find the source in firefox/chrome debugger to step through the code. All the javascript I see is from the base template(can't see this either in chrome).

How do I view this injected template html and internal javascript in the debugger or is there another way to debug this without reworking the entire template and moving the javascript to another file?

I did not see in firefox debugger a javascript file that I placed in the static folder and referred from *.html file.
After following this tutorial I saw that it is possible. I started commenting out parts from my application, hoping to find which part is causing this issue.
In the end, I found out that my javascript file contained wrong syntax in one of the "if" conditions:
if foo() {
instead of
if (foo()) {

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM