Structure in JavaScript coding

Discussion in 'Scripts' started by CaldwellYSR, May 2, 2012.

to remove all ads.
  1. CaldwellYSR

    CaldwellYSR Member

    Messages:
    658
    Im trying (again) to learn my way through JavaScript. The first time I tried I was quickly overwhelmed because I had barely learned HTML && CSS at that point. Now I feel more comfortable and want to give it another swing. In the downtime between then and now I have taken an introductory programming class at school that focused on Java programming. I picked up on it very quickly because of how strict the data types and the structure of java code is.

    I know JavaScript and java are completely different but the flexibility of JavaScript is really bothering me and making it so hard to learn. So what's the best or most common way to structure JavaScript code? How can I set up classes and actionlisteners similar to Java? Is it even possible?
     
  2. Phreaddee

    Phreaddee Super Moderator Staff Member

    Messages:
    1,978
  3. ronaldroe

    ronaldroe Super Moderator Staff Member

    Messages:
    1,223
    I have the same problem. The only way I've been able to actually work with JS at the level I need to was to look at it as "find this, do that". From there, it was really just syntax.
     
  4. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,611
    In javascript they are known as event listeners

    and class constructors are similar to C++ constructors
     
  5. leroy30

    leroy30 New Member

    Messages:
    485
    Look into jquery. Once you grasp it you'll find it really useful and save a lot of common javascript tasks, namely object selection.
     
    Last edited: Jun 16, 2012

Share This Page