Jump to content

Php V/s Javascript

Recommended Posts

Hi all, My question is related to both PHP and JavaScript, and as such didn’t know the forum where to post my query.Firstly, I would like to know if JavaScript can be totally done away with from a PHP page. That is, can a site,developed entirely in PHP (minus JavaScript), perform all functions that could otherwise be performed by using JavaScript embedded into the PHP pages? Secondly, what choice does a developer have in case he does not want to include JavaScript at all in a site developed entirely in PHP? Would the exclusion of JavaScript make the site less functional? Is there anything that JavaScript can, but PHP cannot? Thanks to all,

Link to post
Share on other sites

There should not be any competetion beetween php and js ..as they are both used in very different purpose. php works in server side so any site can be made using php with full function. js comes into play when you need to do something after serving the page...when you need to change the page dynamicaly.

Would the exclusion of JavaScript make the site less functional?
Its depends on the site. here in this board you can see the text editor which is run by js. it can be done without using js too..but using the js and ajax makes it more attractive. js mostly used as fancy slick desighned application
Link to post
Share on other sites

As mentioned, you should understand their differences and where, when, and why each one is used. As birbal said, it's not a competition between the two. One is (almost) exclusively client side (JS), and one is exclusively server-side. (PHP). You use them for different things and often together, as in the case of AJAX driven functionality.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...