Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jul 2007
    Posts
    571
    Thanks
    25
    Thanked 28 Times in 28 Posts

    Importance of Javascript

    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?

  • #2
    Regular Coder
    Join Date
    Sep 2007
    Location
    Raleigh, NC
    Posts
    273
    Thanks
    7
    Thanked 59 Times in 52 Posts
    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.

  • #3
    New Coder cheat's Avatar
    Join Date
    Nov 2006
    Location
    England, Britain
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    -->
    </script>

    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
    //--><!]]></script>

    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}

  • #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    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.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #5
    Regular Coder
    Join Date
    Nov 2007
    Location
    Leeds, UK
    Posts
    514
    Thanks
    24
    Thanked 19 Times in 19 Posts
    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
    ASP, HTML, PHP, AJAX ECt...

  • #6
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,725
    Thanks
    6
    Thanked 1,013 Times in 986 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •