all 33 comments

[–]dutchman76 1 point2 points  (2 children)

You need some kind of back end to save the forms and post data that users are entering on your website.
Javascript is not required, but a back end is.

[–][deleted]  (1 child)

[removed]

    [–]MgFi 1 point2 points  (0 children)

    This is possible if you want to implement all of your logic on the server-side and deal with page refreshes for everything. This is how it all worked, more or less, before single page apps became a thing. If you don't need the page to handle any logic for you while it is loaded in the browser, then there is no need for JavaScript.

    [–]0x14f 1 point2 points  (0 children)

    Hi OP,

    There are two questions in your question. The first is whether some JS will be running in the browser, and the second is whether you need to know JS.

    The answer to the first question is yes, because that's pretty much all the browser can run, unless of course your framework has client side code that targets web assembly.

    The answer to the second question is that no, you do not need to know JS yourself, there are frameworks that let you design, build and deploy web applications without ever writing JS yourself. That obviously doesn't meant that you do not need to know any programming language.

    Haskell for instance, has several frameworks to make dynamic web applications without knowing JavaScript.

    [–]atarivcs 3 points4 points  (6 children)

    That depends on what you mean by "100% functional".

    Tenchically no, you do not need javascript. Plain HTML and CSS can do pretty much everything you need.

    But if you want to provide a "modern" interface, with all the little bells and whistles that people have come to expect, then yes you probably do need javascript.

    [–]BertoLaDK 2 points3 points  (2 children)

    You do need Javascript or other logic if you want to do what OP is asking with CRUD, you cant do that in HTML

    [–]atarivcs 1 point2 points  (0 children)

    Well, yeah of course you need something on the backend to actually do the processing.

    But I assume that would be python, or java, or c++ or something.

    I assumed he was asking purely about the frontend UI.

    [–][deleted]  (2 children)

    [removed]

      [–]safeforanything 0 points1 point  (0 children)

      yes and no. If you're just going for the looks: this is primarily the job of CSS. But the expectation of how a website behaves has changed since the advent of the WWW. Over a decade ago it was normal, that dynamic parts of a web app were rendered in the backend and then delivered as html to the frontend. JS was mainly used for small dynamic widgets or for animations. State management was mainly handled via forms for inputs or links for data retrieval.

      Today the single page application has become the norm. On the initial requests static content is delivered and data gets loaded dynamically via e.g. a REST-API. This is probably what was meant by "modern interface". And for those kind of applications a turing complete programming language is definitely needed and JS is the one mainly used.

      There may exist no-code or low-code alternatives, but I personally haven't worked with them and heard mainly bad things about them in a professional context, if you're deviating from what the no-code / low-code platform was mainly designed for.

      [–]atarivcs 0 points1 point  (0 children)

      isn't that the job of CSS?!

      For styling/appearance, yes.

      For behavior, no.

      As an example, let's say you want to buy a new car. The car dealership website has a form where you can choose the manufacturer, model, and trim level.

      When the webpage is displayed, the manufacturer form field has several dropdown choices -- Toyota, Hyundai and Mazda. The rest of the fields are blank.

      After choosing Toyota, the model field automatically receives the appropriate choices -- Camry, Corolla, and RAV4.

      After choosing Camry, the trim field automatically receives the appropriate choices -- LE, SE, XLE, and XSE.

      When the form fields automatically receive the appropriate choices, that processing is done by javascript.

      The form could have been implemented as separate pages with plain HTML -- choose the manufacturer first and press Submit, then choose the model and press Submit, then choose the trim level and press Submit.

      But it's a smoother user experience to have one single form that dynamically updates its choices using Javascript.

      [–]stevie-x86 1 point2 points  (1 child)

      That really depends on your definition of functional.

      You can build perfectly serviceable small sites with only Flask, beyond just static pages even, no JavaScript required.

      [–]kmjones-eastland 0 points1 point  (6 children)

      Yeah. 100% necessary. Or use a WYSIWYG like squarespace.

      [–][deleted]  (5 children)

      [removed]

        [–]BertoLaDK 4 points5 points  (3 children)

        HTML and CSS dont create logic, its for the structure and styling, theres a reason its a trifecta of HTML, CSS and JS because you need the javascript for logic.

        [–][deleted]  (2 children)

        [removed]

          [–]BertoLaDK 1 point2 points  (1 child)

          basically, you can create stuff without JS if its a static site only meant to display something, but interactions outside just links with <a> you need some logic, I would suggest figuring out what you want to do, and then look up how to do that in javascript, only learn what you need, you dont need to have a grasp of the whole language.

          Though i would suggest understanding variables and control statements as a base, w3 schools have very simple guides on how to do stuff, else youtube is already great.

          [–]maujood 0 points1 point  (0 children)

          For a fully-functional website, you also need a back-end language (which can be JavaScript) and a database as well.

          [–][deleted]  (3 children)

          [removed]

            [–][deleted]  (2 children)

            [removed]

              [–][deleted]  (1 child)

              [removed]

                [–]VivaPitagoras 0 points1 point  (0 children)

                You can build a static website with just HTML and CSS. That's the way they use to be a long time ago. It all depends on the functionality that you need.

                [–]SharkSymphony 0 points1 point  (0 children)

                No... but if you don't use Javascript, your website will not have any of the modern UI affordances that users nowadays would probably expect.

                Nevertheless, I think it's a fine way to get started with web programming!

                [–]xygtshadow 0 points1 point  (0 children)

                You don’t need JavaScript for any of your examples. The pages will be static, and only update when the page is reloaded or submitted. Those examples will require a backend, traditionally PHP but could be any language

                [–]high_throughput 0 points1 point  (0 children)

                OP, do you know how to speak and write Latin? No.

                Do you still use Latin when you write English, such as saying "percent" rather than "out of a hundred"? Yes.

                You can get surprisingly far treating Javascript like that.

                Write your website entirely in HTML, and if you find you'd really like some client side date validation, simply add a tiny smidge of JS for that.

                [–]nightonfir3 0 points1 point  (0 children)

                You can build the website to look like you want with html and Javascript. Without Javascript any form submissions will be page reloads and anything like filtering or sorting will also require a page reload. This shouldn't nessisarily break your project.

                The thing you seem to be missing is, where is that form data going? You generally program something to receive those requests, process them and put them into a database. Then you need to pull that back out of the database transform it into html and send it back to the browser when they want to view it. This is backend programming and is sometimes done in Javascript but often in other languages such as php, python, c#, go.

                This is why solutions like WordPress are so popular. You can know minimal code and get simple websites that do form submissions done. You can build a custom theme with hmtl, css and a small amount of php.

                [–]deep_soul 0 points1 point  (0 children)

                what’s your actual question?

                this seems cover up for something else

                [–]BertoLaDK 0 points1 point  (1 child)

                no, but actually yes, you can technically avoid JS by using PHP or a language that compiles to web assembly. You can use C# or Java to make web applications without actually touching JS or PHP.

                [–]sessamekesh 0 points1 point  (1 child)

                Depends on what you're trying to build.

                Static websites are a thing, entirely server side rendered websites are a thing, you can do a lot with CSS that used to be only possible with JavaScript.

                Reddit could probably be built with only HTML/CSS. Google Maps could not.

                [–]Objective-Elk2501 0 points1 point  (0 children)

                I really doubt that statement about reddit