This may sound like a silly question but I'm going to ask anyway because it's almost affecting my learning ability. :)
Why do we use JavaScript to change HTML and CSS elements in a webpage when we can just do that in HTML and CSS? As I'm learning JavaScript and changing elements in the DOM I'm asking myself why... why would you want to randomly change text color?
My idea is that they're event based changes and more for the interaction between user and webpage? Like in an image carousel, clicking the arrows would slide in a new image.. am I on the right track with understanding?
Latest comments (37)
Good night. lol, had to.
Ok I didn't invent web apps, no need to get upset with me... but thanks for the link.
Well we could standardize a file format for making desktop applications using HTML, CSS, and JS so that you'd just run the file with the browser of your choice, but then at that point you're making an open source
jarfile (which could be a good idea if done right)those programs are big because they're packaging the whole headless browser with them which is unnecessary.
How do you quote in the comments? :)
People do a lot more on their computers than just microsoft office and default email. Sometimes it's just easier to open one desktop app (the browser) and do a lot from there. The average user doesn't really care much about technical specs, they just want convenience.
Out of curiosity, why are you anti web app?
I think most people like the convenience of not having to install a desktop app for every single thing they use their computers for. The space alone on that would get kind of crazy. I use my computer for a lot and a lot of the time I have a web app open.
I think the user should have more control over what the browser allows pages to do but I do think that at the end of the day, if your computer can do it, the web should be able to do it too. and no i don't see a problem with pages using more that 1GB of RAM since many games use more than 1GB and i'd love for them to come to the web. the Web has more work to do to in regards to functionality and user control but if you think that web should only be used to pass files around then there isn't much I could say to convince you we're on a good road. however, I believe that the web is the best platform for application deployment ever made even though it wasn't originally made for that 30 years ago (and can still be used for open directories). many of the services we take for granted nowadays simply couldn't exist on the web back then because internet infrastructure did not have the bandwith to support the web as an application distribution platform. but that's changed since and the browsers are catching up.
"secure environment" was referring to site isolation, requiring https for many APIs, not being able to access the user's local machine, etc.
"The browser is not an operating system" but it can be. and will be in the coming future. if not now. the web has evolved.
"glorified document viewer" the web has evolved. a lot. we've done a lot in the past 30 years. with the vast majority of that change in the past 5 or so actually.
"one scripting language" it's the language of the Web, and many many things compile to JavaScript. with more things every day (the most widely used high level programming language on the planet)
"does not even have strong typing" natively. yet. but many of the compile-to-JS languages do.
"reasons why video games are usually running natively" lack of certain networking protocols (recently added as WebSocket and WebRTC) and memory constraints (most browsers crash a page if it passes 1GB in a tab, but that could easily be changed or given as a permission to the user)
the browser is a desktop application. think of your web browser similar to a game launcher. bringing my code to you in a secure environment and with automatic updates.
Makes a lot of sense. That would almost be like a video game completely reloading every time the player makes a move.
Fair enough, but that such differences in rendering typically result in having an imperfect but quite usable web app on pretty much all modern browsers (unless you're doing really fancy things). So you immediately cast a very wide net.
For cross-platform (say the latest few Windows versions, the most prevalent linux distros, OSX and IOS, android - nothing exotic), you have to actively account for each of those groups, and make sure that executables or installers are available, including distributing updates. It's perfectly doable of course, but it's very much not in the same category of effort as a web app.
From the point of view of the user of the UI: because I can read and interact with the application on different laptops, PCs, tablets and smartphones, and all I need is one ubiquitous kind of application (i.e. a web browser) and my login credentials.
From the point of view of the creator of the UI: because I can create an application that people can read and interact with on different laptops, PCs, tablets and smartphones, without me needing to make and maintain separate applications for all those types of hardware.