What do I need to know about Java in JavaScript?

advertisements

This isn't as progressive as it sounds. Im not taking the whole "Oh I know Java, that must mean I can write in JavaScript too!" attitude. I have some education on Java under my belt, but now find myself having to do some PHP web development (which I have little experience in) using Java Script to handle some of the logic. But before going out and buying 2 or 3 books on JavaScript and diving right into it, I figure I might ask those that might have gone through the same experience. It appears that JavaScript lives and acts in its own environmnet which makes want to take the approach taking in JavaScript and PHP as a bundled package in my learning endeavors. JavaScript is similar just enough to Java that I will tend to make some dangerous assumptions. Should I treat JavaScript and PHP as one item, or should I still take this step by step and learn one at a time? What are some pitfalls that I might run Into? What are the main differences between the languages? Is there any litterature that has helped? Thanks Everybody.


What do I need to know going from Java to JavaScript?

That they are completely different languages. The Good Parts is a good introduction to the core JS language for existing programmers. You'll also need to learn DOM and other browser APIs if you want to use client side JS for anything practical.

Should I treat JavaScript and PHP as one item

No. They are completely different. Even when you know both of them you should be writing things that work with plain HTML and PHP, then layering JS on top.