On a similar note, does anyone know if it's possible without JavaScript for a link or form or something similar to be submitted without the whole page refreshing and still being able to update some text? For example, the upvote, favorite, and reply actions on hacker news website. They all require a whole page refresh. Is it possible to achieve it without page refresh and without JavaScript?
Building websites with lots of little HTML pages
81–88 of 88 posts
Re: Building websites with lots of little HTML pages
#82I love this approach. I just wish there was better tooling for HTML polyglot programming. PHP got it right by embedding itself within "HTML" documents. React also got it right by inventing JSX. There's Go templ too. They all said "HTML deserves first class support". Why can't this DX also be available for other general purpose PLs? I want my Python language server to detect that this or that string is HTML, and provi…
Slowly but surely... PEP 750 (still a proposal) adds "t-strings" Python. They're a simple extension of f-strings that give developers access to the static and interpolated parts of the string before they get combined into a final string. They're Python's answer to JavaScript template literals. This allows writing code like: user_name = current_user.user_name # something user-supplied and potentially unsafe foo: HTMLE…
Re: Building websites with lots of little HTML pages
#83Earlier quoted context omitted.
Slowly but surely... PEP 750 (still a proposal) adds "t-strings" Python. They're a simple extension of f-strings that give developers access to the static and interpolated parts of the string before they get combined into a final string. They're Python's answer to JavaScript template literals. This allows writing code like: user_name = current_user.user_name # something user-supplied and potentially unsafe foo: HTMLE…
Great! Hope the proposal gets support.
Re: Building websites with lots of little HTML pages
#84On a similar note, does anyone know if it's possible without JavaScript for a link or form or something similar to be submitted without the whole page refreshing and still being able to update some text? For example, the upvote, favorite, and reply actions on hacker news website. They all require a whole page refresh. Is it possible to achieve it without page refresh and without JavaScript?
Have you tried HTMX?
Re: Building websites with lots of little HTML pages
#85Re: Building websites with lots of little HTML pages
#86On a similar note, does anyone know if it's possible without JavaScript for a link or form or something similar to be submitted without the whole page refreshing and still being able to update some text? For example, the upvote, favorite, and reply actions on hacker news website. They all require a whole page refresh. Is it possible to achieve it without page refresh and without JavaScript?
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#...
However the user experience is pretty rough, which is why people typically don't use this feature.
If you want a minimal amount of javascript to achieve this, we (the htmx folks) also have fixi:
https://github.com/bigskysoftware/fixi
Finally, we are working on introducing general transclusion into the HTML spec itself with the triptych project:
https://github.com/alexpetros/triptych
however that is a ways off (if ever)
Re: Building websites with lots of little HTML pages
#87Earlier quoted context omitted.
Did you end up getting notifications working with your PWA? That's something I've worried about
> However, when I was about to give up and abandon the entire project, I had one of those moments, and got it to work. Yes. So much relief. Although it was a bit more difficult than I thought it would be.