Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

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.