imHemant Posted July 19, 2012 Share Posted July 19, 2012 What are the advantages & disadvantages of PHP & JavaScript? Can anyone demonstrate the situations with code where it is better to make use of PHP and situations where it is better off to apply JavaScript? I'm asking this to best implement both the languages! Thanks in advance to the people who can help me! Thank you! Link to comment Share on other sites More sharing options...
birbal Posted July 19, 2012 Share Posted July 19, 2012 (edited) There is no comparison between php ad js. they are different by nature and you can compare things which are nature wise same, you can compare PHP with ASP, JS with VBscript but you can compare JS and PHP.php is server side language. js is is client side language. once page is requested and served it is out of scope of php. js can work on the served page dynamically like changing the document structure. JS can change anything server side it has scope only in browser (though now NODE.js uses javascript for serer side handling) Edited July 19, 2012 by birbal Link to comment Share on other sites More sharing options...
davej Posted July 19, 2012 Share Posted July 19, 2012 I suppose you might be able to say that anything that can be done properly with JS should be done with JS and PHP should be used only where necessary. In many cases it is best to use both JS and PHP working together. Link to comment Share on other sites More sharing options...
Ingolme Posted July 19, 2012 Share Posted July 19, 2012 Anything that can be done with Javascript should always have a PHP alternative for people who have Javascript disabled. Javascript is unreliable. There's no Javascript vs PHP because they both perform different functions and usually work together. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now