Sorry, I am still trying to teach myself Javascript and I was wondering whether someone knew the best way开发者_JS百科 to write object oriented Javascript with classes that will interact well with PHP classes.
Javascript is already object oriented, in regards to classes there are many ways in which to achieve "templates". Since you are new to Javascript have a good read of any material from Douglas Crockford especially his book The Good Parts as he will enlighten you to the the true nature of Javascsript.
This leads me to the second part of your question, as to interacting well with PHP, my advice (from experience) is to have a good clear data serialization/deserialization layer from which you interact, JSON will help you immensely. Don't try and be clever, Javascript is a very different language to PHP. Work with the language not against it.
Happy coding :)
精彩评论