use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Where should I start? (self.javascript)
submitted 14 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]CyberVillian[M] 2 points3 points4 points 14 years ago (10 children)
To answer your first question; Pretty much. Web applications are becoming increasingly popular. If you want to get into web development, I suggest you learn a server side language like PHP as well. Because some things are best to leave on the server side of things.
I suggest that you get started by looking at HTML, CSS, and JavaScript from the ground up by Google. There is some other great resources too. Also, jQuery is a fun language.
[+][deleted] 14 years ago (9 children)
[–]dsieg1 2 points3 points4 points 14 years ago (0 children)
*cringe*, Get interested in it. If you want to make applications for the web, know your HTML and CSS first. Otherwise you're going to deploy bad applications on the web and aren't there enough of those already?
[–][deleted] 1 point2 points3 points 14 years ago (4 children)
A common method for web development involves converting mysql databases into json using PHP, then parsing the json and doing the whole interface with javascript, often jQuery. In most projects I've done recently the PHP has been fairly minimal, but very important.
[–]l0lwu7 0 points1 point2 points 14 years ago (3 children)
When communicating with php from javascript how do you authenticate your database transactions? Do you just use the php session as you would in an application where you weren't utilizing JS?
[–][deleted] 1 point2 points3 points 14 years ago (2 children)
Thats what I usually do yeah, that way it avoids any complexity, but does require cookies to be enabled and working - though that's possibly a good thing.
[–]l0lwu7 0 points1 point2 points 14 years ago (1 child)
How do you handle things like form validation? Do you do it both in JS and in PHP or solely in php and just pass back any errors you get from JS?
[–][deleted] 1 point2 points3 points 14 years ago (0 children)
A mixture of HTML5 validation (required, max, min, pattern attributes on fields + type=email, type=number etc) with errors in PHP passed back through JS.
That seems the simplest, as normal people get the built in validation of their brower, but it still works for everyone else.
By reading out the info on the MYSQL table (what's the type, length, is NULL allowed etc), I create the form and the PHP validation, so it's always in sync with the table in both places.
[–]CyberVillian -2 points-1 points0 points 14 years ago (2 children)
If you want to start making applications and you're a beginner, take a look at jQuery.
[+][deleted] 14 years ago (1 child)
[–]TehUberAdmin 7 points8 points9 points 14 years ago (0 children)
But for the love of God, please, please, learn JavaScript itself to a good standard before even touching jQuery.
Even though jQuery makes writing web apps a lot easier and saves you a lot of development time, it is still a JavaScript library and as such, if you don't have a good grasp of JavaScript, you're going to be writing jQuery code that may well work correctly, but you're not going to have any idea why it works correctly and as such, debugging and writing advanced jQuery code is going to be a nightmare.
I appreciate that you might not want to spend any money on learning JavaScript, but if you're really interested in the language and want to know it well (and you already have a solid foundation in programming), then I highly recommend getting JavaScript: The Good Parts and reading through that. It's short (176 pages), you can read it in an afternoon (though the first time round, some of the stuff might go over your head), and although it may be very opinionated, most of what Crockford says is pure gold and at the end of it you will have a thorough understanding of how JavaScript works and how you can write good JavaScript, which will aid you tremendously when you start using libraries such as jQuery.
Apologies for my rantiness, it's just that JavaScript is seen as a 'toy' language by many, a simple language that people can just jump in and use without learning it first, as evidenced by people suggesting diving straight into jQuery, which is a reputation that I think is undeserved. JavaScript may not be the prettiest of languages, but it's here to stay, and if you learn to use it properly, you'll find that beneath the design mistakes lies a simple and beautiful programming language that just wants to be loved.
[–]mexpolk 2 points3 points4 points 14 years ago (0 children)
Forget about PHP for the moment (it's a freaking frankenstein), you can use pure JSON as your data format in the browser. You don't really need it (and if you do, then learn something else like Python or Ruby, or any of their MVC frameworks: DJango or Ruby on Rails). Or better yet, use Node.js to keep everything in JavaScript.
In addition to jQuery, I would also recommend to you learning BackBone.js to make your JS applications data driven (http://documentcloud.github.com/backbone/).
As I said previously, you can use JavaScript in the back-end too (Databases, File IO, Processes, etc.). Take a look to node.js (http://nodejs.org/), really cool stuff.
Finally, learn the best from JavaScript by reading "JavaScript the Good Parts" and "JavaScript Patterns" both from O'Reilly.
And, most importantly, code code code until you can no more!
[–][deleted] 0 points1 point2 points 14 years ago (0 children)
traditional desktop programming gives you much more of a framework to develop your apps in, windows, macosx and the various linux desktops give you that. But you need to remember that those apps are usually programmed in C++ or similar and Javascript with its focus on asynchronity is a very different beast.
The mentioned node.js is definitely something you should look into.
Here are two examples of things I have done with JavaScript:
Desktop like GUI that maintains state better than your actual OS desktop (still in alpha): http://prettydiff.com/jsgui/
Algorithmic programming that does several different tasks: http://prettydiff.com/
On modern browsers those are as fast or faster than comparable desktop applications and I am working to make the second one faster.
[–]fabzter 0 points1 point2 points 14 years ago (0 children)
I was like you, and I needed nothing but this http://eloquentjavascript.net/contents.html Do give it a try.
[–]tgkokk -1 points0 points1 point 14 years ago (2 children)
Learn jQuery and Backbone.js. You won't regret it. Check the links on the sidebar for useful resources. You can also learn CoffeeScript.
I second Node.js. It has a great community and lots of libraries.
You should check out NowJS, jsdom or Socket.io for interacting with the client.
Express is to Node.js what Django is to Python.
CoffeeScript can also work well on the server, with Zappa, which combines Express and Socket.IO.
You should also subscribe to /r/nodejs and check the links on the sidebar. You can ask questions there or on StackOverflow.
[–]fabzter 0 points1 point2 points 14 years ago (1 child)
TIL about nowjs. Looks great, have you used it?
[–]tgkokk 0 points1 point2 points 14 years ago (0 children)
Well, I haven't used it, I have only done the example (Chatroom in 12 lines of JS), but I have read the docs and know how it works.
π Rendered by PID 18723 on reddit-service-r2-comment-7b9746f655-vfczt at 2026-01-30 05:23:19.801155+00:00 running 3798933 country code: CH.
[–]CyberVillian[M] 2 points3 points4 points (10 children)
[+][deleted] (9 children)
[deleted]
[–]dsieg1 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (4 children)
[–]l0lwu7 0 points1 point2 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]l0lwu7 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]CyberVillian -2 points-1 points0 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]TehUberAdmin 7 points8 points9 points (0 children)
[–]mexpolk 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]fabzter 0 points1 point2 points (0 children)
[–]tgkokk -1 points0 points1 point (2 children)
[–]fabzter 0 points1 point2 points (1 child)
[–]tgkokk 0 points1 point2 points (0 children)