468,554 Members | 1,878 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,554 developers. It's quick & easy.

Given that some browsers dont have javascript enabled....

Given that some browsers dont have javascript enabled.... do developers try
to avoid using javascript when a php alternative can be used? What sort of
alternative php scripts are often used?

Jul 16 '05 #1
2 3371
"ChronicFatigue" <NO*********@chronic-fatigue.co.uk> writes:
Given that some browsers dont have javascript enabled.... do developers try
to avoid using javascript when a php alternative can be used? What sort of
alternative php scripts are often used?


Yes, people do (or at least *should* if they don't) use PHP (or
another server-side language) instead of Javascript if possible.

As far as what PHP does, that depends what Javascript is doing. I
suppose a common example would be handling form submission, which can
be done in either Javascript or PHP, but can only be *sensibly* done
server-side in PHP.

If you give specific examples of things done with Javascript then it's
easy enough to say whether there's an obvious PHP alternative.

--
Chris
Jul 16 '05 #2
"ChronicFatigue" <NO*********@chronic-fatigue.co.uk> wrote in message news:<bg**********@sparta.btinternet.com>...
Given that some browsers dont have javascript enabled.... do developers try
to avoid using javascript when a php alternative can be used? What sort of
alternative php scripts are often used?


Everything you *need* to do should be done in PHP. Javascript is only
for fancy cosmetic stuff therefore it is not *necessary*. Any
client-side validation you want to do with javascript should always be
done server-side within your PHP script just in case the client has
javascript disabled. Also remember that it is possible for someone to
get your HTML source, edit or remove the javascript then submit the
page. This could potentially lead to a disaster if you did not
double-check everything within your PHP script.

Tony Marston
http://www.tonymarston.net/
Jul 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by niftyhawk | last post: by
5 posts views Thread by vsr | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.