Javascript in a php document

B

Bo Dudek

Hi

I have this thought, that I'd like to share:

Sometimes I'm using javascript in my webpages to create different kind
of form-interactions. Sometimes I have an inputfield, and in this
field theres a short description text like "Type your name here".

When a user clicks the field, I use the OnFocus and OnBlur
eventhandlers to remove the description text to allow the user to type
his own text.

But isn't it right, that no matter what I do, the javascript will
ALWAYS be interperated by the users browser and NOT by the server? And
therefore, if the user doesn't allow javascript, he won't be able to
use my little nifty thing?

Kind regards
Bo Dudek
www.bodudek.dk
 
L

Lasse Reichstein Nielsen

But isn't it right, that no matter what I do, the javascript will
ALWAYS be interperated by the users browser and NOT by the server?

Absolutely correct.
And therefore, if the user doesn't allow javascript, he won't be
able to use my little nifty thing?

Correct. That is why Javascript should only be used to enhance a page,
not to create the basic fuctionality. There are quite a lot of people
who browse without Javascript (11% in some counts), either because
they use browsers without Javascript or because they have turned it
off. A good page should degrade nicely when Javascript isn't
available, and still retain full functionality, even if it might
require a little more work to use it.

/L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top