Help Learning JavaScript

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
lavaeagle
Forum Newbie
Posts: 21
Joined: Thu Sep 09, 2010 1:41 pm

Help Learning JavaScript

Post by lavaeagle »

I come at this language with a PHP and SQL background and I want to learn more but I have trouble understanding a couple things about JavaScript that would GREATLY help me understand the language better. I am already learning JS from w3schools and tizag so I have plenty of tutorials.

What I don't understand:
- Where are it's practical uses?
- What is the syntax? It seems to change according to what your affecting.
- What are some good exercises or things to build that would get me well acquainted with JS?

Thank you for your help!
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: Help Learning JavaScript

Post by s.dot »

Having a php background will greatly help you learn javascript.

You should know that it's highly object oriented.
The syntax is very much php-like.
There are a lot of javascript libraries (jQuery, yahooui, etc) to make writing javascript easier and less tedious
It's only practical reasons are for doing cool things and helping your end-users get better response on your site (such as data pre-validation).

A good exercise would be to make a form and then use javascript to validate it and catch errors onsubmit.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Help Learning JavaScript

Post by califdon »

I certainly agree with s.dot, but to address your broader question about its practical uses, you should know, first of all, that Javascript is essentially the ONLY client-side (i.e. browser interpreted) language that is used, so absolutely everything that you want to happen in the user's browser must be written in JS. As you know, once PHP has been parsed and executed on the server, the HTML (and JS) is sent to the browser and PHP is finished--kaput! So if you want something to happen on that page AFTER it reaches the browser, that has to be done in JS.

So, "practical uses" would surely include menus, rollovers, AJAX requests back to the server, client-side user input validation (as s.dot suggested), animation, image substitution, etc. etc.
lavaeagle
Forum Newbie
Posts: 21
Joined: Thu Sep 09, 2010 1:41 pm

Re: Help Learning JavaScript

Post by lavaeagle »

Hey thanks guys I am absolutely going to practice that!
Post Reply