Jump to content

Using PHP for client-side functionality


Eiolon

Recommended Posts

I've been kind of overwhelmed with Javascript or AJAX.  For some reason it doesn't sink in to me like PHP does.  I decided to use PHP for some client-side functionality and I am wondering if it's even a good idea to do so in the first place.

 

For example, if I want a DIV shown, instead of Javascript, I use a POST to show the div.  I will set the variable:

 

$showDIV = '0'

 

for when the page loads

 

Then when the link is clicked to show the div, the page will POST and change $showDiv to equal 1.  If showDIV equals 1 then show the div.

 

 

I am just looking for input if I should continue down this path or not.

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/207979-using-php-for-client-side-functionality/
Share on other sites

Its up to you really. Its probably going to make your site little clunky compared to what can be achieved with a server-side, client-side combination but it will also make your site more accessible (not that many people have js disabled these days).

 

Maybe you should have a look at one of the Javascript frameworks. jQuery (http://jquery.com) really does make Ajax & DOM manipulation very simple.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.