View Full Version : Importance of Javascript

11-13-2007, 03:57 AM
Well, I'm nearing the 6month anniversary since it took my first steps into the web development world! I started with HTML & CSS and after about 3months of that I slowly started learning PHP. The one thing I have never touched is JavaScript. How essential do you think it is to know javascript?

11-13-2007, 04:09 AM
In the modern age it's becoming increasingly more important. Both because browsers are starting to implement consistent standards (DOM manipulation for one), and also because modern webpages are expected to have a certain level of interactivity in the interests of usability.

AJAX can be a four-letter word in the wrong hands, and a lot of people are implementing it "just because," but it really is a great technology that can do things to your site that were never thought possible.

If I were you, I would pick up Javascript. It's not very difficult, and it opens up opportunities to break through the limitations of tough behavioral choices in design. What I DON'T recommend you do is go to sites like DynamicDrive and just pull scripts and try to pick them apart. A beginning book on DOM scripting would really be a great place to start, but I would just look for websites that offer beginning DOM manipulation tutorials as a starting point.

Simple things like hiding divs, creating page elements dynamically, and changing classes on elements are great places to start.

11-17-2007, 05:17 AM
javascript can sometimes be a nightmare when it comes to cross browser compatibility but even if the user had javascript disabled the script wont just roll over and implode.

with javascript you can:

validate user input before sending the page off to a server, which saves on your bandwidth,

your viewers dont have to wait for the entire page to reload when checking information.

with PHP the page would have to be recalled from the server and then printed on your screen. this can take time. with javascript you are not recalling from the server over and over again. instead the information you need is there without loading the rest of the page at the same time.

javascript dramatically increases the possiblities of your website(s)

but of course as with all scripting languages its not perfect.
lets say i just wanted a simple javascript you would normally do.

<script type="text/javascript">
//script here

but of course if we were using strict xhtml then you would need to use CDATA i.e

<script type="text/javascript"><!--//--><![CDATA[//><!-
// place your code here

i would go into more detail but frankly it would take too long. if you have any questions email me at
lifeforce19 @ hotmail.co.uk {remove spaces}

11-17-2007, 05:55 AM
If you want your web page to be able to interact with your visitors without having to reload the whole page from the server each time then JavaScript is your only choice. Get it working without JavaScript first though and implement the JavaScript so that it speeds up the interaction for the 90% of people with it enabled.

11-17-2007, 11:22 AM
Mate i am like you
Web Building web sites for about a year i know alot of php now
and i have just started to teach my self javascript a good place to learn the basic for me was
W3Schools.com - that have tutorials on All Web Langs

11-17-2007, 02:27 PM
What y’all should be aware of is that JavaScript should only be an addition to/an enhancement of your site, not the substantial thing its functionality is relying on. As said before, JS can be switched off or not be available at all in some browser for some reason, and for this reason everything should work alright and properly without any JS before you start “messing around” with it.

E. g. for substantial form validation a server side script will still be necessary but JS/AJAX can increase functionality/speed/usability a lot if added afterwards.