imHemant 0 Posted July 19, 2012 Report 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! Quote Link to post Share on other sites
birbal 168 Posted July 19, 2012 Report 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 Quote Link to post Share on other sites
davej 251 Posted July 19, 2012 Report 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. Quote Link to post Share on other sites
Ingolme 1,035 Posted July 19, 2012 Report 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. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.