• witty_username@feddit.nl
    link
    fedilink
    English
    arrow-up
    0
    ·
    13 days ago

    If I’d want to write a site with js-equivalent functionality and ux without using js, what would my options be?

      • unwarlikeExtortion@lemmy.ml
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        13 days ago

        You can’t modify the DOM.

        But some most dynamicity can stay - sites can be built freely server-side, and even some “dynamic” functionality like menus can be made using css pseudoclasses.

        Sure, you won’t have a Google Docs or Gmail webapp, but 90% of stuff doesn’t actually need one.

        A basic website doesn’t require js.

        A webshop, for example, does for the part around adding to cart and checkout - but it doesn’t for merely browsing.

    • TrickDacy@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      13 days ago

      I mean you could build a site in next.js, ironically. Which is very counter intuitive because it literally is js you are writing, but you can write it to not do dynamic things so it effectively would be a static server rendered site that, if js is enabled, gets for free things like a loader bar and quick navigation transitions. If js is disabled it functions just like a standard static site.

    • dondelelcaro@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      13 days ago

      htmx or equivalent technologies. The idea is to render as much as possible server side, and then use JS for the things that can’t be rendered there or require interactivity. And at the very least, serve the JS from your server, don’t leak requests to random CDNs.

    • Hellfire103@lemmy.caOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      13 days ago

      HTML and CSS can do quite a lot, and you can use PHP or cgi-bin for some scripting.

      Of course, it’s not a perfect alternative. JavaScript is sometimes the only option; but a website like the one I was trying to use could easily have just been a static site.