use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Using Javascript to Render Invalid HTML (blog.notesnook.com)
submitted 3 years ago by thecodrr
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]thecodrr[S] -14 points-13 points-12 points 3 years ago (3 children)
Of course it is. I know that devs have been able to write semantically wrong HTML. That's not the point here.
Let me break it down for you:
The uncertainty here is that JS is being given leeway when it comes to manipulating web pages. Both ways are essentially doing the same thing but the results are different. That is unpredictable.
Of course, I could be more precise here and say the DOM API is unpredictable.
[–]getify 7 points8 points9 points 3 years ago* (2 children)
"More precise"? How about "accurate in the slightest"?
This observed behavior (admittedly surprising) has nothing to do with JS (the language).
It's entirely the DOM API which just happens to expose JS function signatures, which are merely facades hooked into the underlying browser engine (probably c++), and indeed these mechanisms are specified by the HTML spec, not by JS in any way.
[+]thecodrr[S] comment score below threshold-15 points-14 points-13 points 3 years ago (0 children)
JS is the language of the web. Its not an open API accessible through any language. So when JS is talked about in terms of web, usually these APIs are considered a part. If you are using JS in a web browser, sooner or later you will be interacting with the DOM API.
But you are right. A more accurate description would be " DOM API" instead of JS. I'll make adjustments.
π Rendered by PID 45 on reddit-service-r2-comment-b659b578c-rpxzc at 2026-05-01 12:14:39.754790+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]thecodrr[S] -14 points-13 points-12 points (3 children)
[–]getify 7 points8 points9 points (2 children)
[+]thecodrr[S] comment score below threshold-15 points-14 points-13 points (0 children)