DEV Community

loading...

Discussion on: print or extend Python output to an HTML file

vickilanger profile image
Vicki (she/her) Author

Wow! Thank you so much for this awesomely detailed response.

DOM makes a lot more sense, thanks.


JavaScript isn't my thing. I just wanna make sure I understand what you gave me. There's a request fetch. Then the then, then, and catch are the exception handling, right? When reading => what should I be saying in my head?

So, the script works, but now the syntax highlighting from prism.js isn't working. I wonder if that's just going to be a tradeoff I have to make.

Thread Thread
miniscruff profile image
miniscruff

Then handles the response as a chain. This is due to the asynchronous nature of JavaScript. The catch is the error handling portion. => is an anonymous function. Think of it as a shorthand for def but inline. Similar to lambda in Python but not limited to one line. Not sure why prism doesn't like it. Might have to pass the text into prism before setting to on the ID. I do not have experience with prism.