• cerothem@lemmy.ca
    link
    fedilink
    English
    arrow-up
    11
    arrow-down
    5
    ·
    edit-2
    2 days ago

    That would make the website feel ultra slow since a full page load would be needed every time. Something as simple as a slide out menu needs JavaScript and couldn’t really be done server side.

    When if you said just send the parts of the page that changed, that dynamic content loading would still be JavaScript. Maybe an iframe could get you somewhere but that’s a hacky work around and you couldn’t interact between different frames

    • Limonene@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      16 hours ago

      a slide out menu needs JavaScript

      A slide out menu can be done in pure CSS and HTML. Imho, it would look bad regardless.

      When if you said just send the parts of the page that changed, that dynamic content loading would still be JavaScript

      OP is trying to access a restaurant website that has no interactivity. It has a bunch of static information, a few download links for menu PDFs, a link to a different domain to place an order online, and an iframe (to a different domain) for making a table reservation.

      The web dev using javascript on that page is lazy, yet also creating way more work for themself.

    • expr@programming.dev
      link
      fedilink
      English
      arrow-up
      5
      arrow-down
      2
      ·
      2 days ago

      https://htmx.org/ solves the problem of full page loads. Yes, it’s a JavaScript library, but it’s a tiny JS library (14k over the wire) that is easily cached. And in most cases, it’s the only JavaScript you need. The vast majority of content can be rendered server side.

      • cerothem@lemmy.ca
        link
        fedilink
        English
        arrow-up
        11
        ·
        2 days ago

        While fair, now you have to have JavaScript enabled in the page which I think was the point. It was never able having only a little bit. It was that you had to have it enabled

        • expr@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          ·
          22 hours ago

          Yes, it is unfortunate that this functionality is not built-in to HTML/browsers to begin with. The library is effectively a patch for the deficiencies of the original spec. Hopefully it can one day be integrated into HTML proper.

          Until then, HTMX can still be used by browsers that block third party scripts, which is where a lot of the nasty stuff comes from anyway. And JS can be whitelisted on certain sites that are known to use it responsibly.

      • XM34@feddit.org
        link
        fedilink
        English
        arrow-up
        3
        arrow-down
        3
        ·
        2 days ago

        So, your site still doesn’t work without JS but you get to not use all the convenience React brings to the table? Boy, what a deal! Maybe you should go talk to Trump about those tariffs. You seem to be at least as capable as Flintenuschi!

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

      JS is just a janky hotfix.

      As it was, HTML was all sites had. When these were called “ugly”, CSS was invented for style and presentation stuff. When the need for advanced interactivity (not doable on Internet speeds of 20-30 years ago), someone just said “fuck it, do whatever you want” and added scripting to browsers.

      The real solution came in the form of HTML5. You no longer needed, and I can’t stress this enough, Flash to play a video in-browser. For other things as well.

      Well, HTML5 is over 15 years old by now. And maybe the time has come to bring in new functionality into either HTML, CSS or a new, third component of web sites (maybe even JS itself?)

      Stuff like menus. There’s no need for then to be limited by the half-assed workaround known as CSS pseudoclasses or for every website to have its own JS implementation.

      Stuff like basic math stuff. HTML has had forms since forever. Letting it do some more, like counting down, accessing its equivalent of the Date and Math classes, and tallying up a shopping cart on a webshop seems like a better fix than a bunch of frameworks.

      Just make a standardized “framework” built directly into the browser - it’d speed up development, lower complexity, reduce bloat and increase performance. And that’s just the stuff off the top of my head.

    • Sir_Kevin@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      2 days ago

      Something as simple as a slide out menu needs JavaScript and couldn’t really be done server side.

      I’m not trying to tell anyone how to design their webpages. I’m also a bit old fashioned. But I stopped making animated gimmicks many years ago. When someone is viewing such things on a small screen, in landscape mode, it’s going to be a shit user experience at best. That’s just my 2 cents from personal experience.

      I’m sure there are examples of where js is necessary. It certainly has it’s place. I just feel like it’s over used. Now if you’re at the mercy of someone else that demands x y and z, then I guess you gotta do what you gotta do.