ajax but disable javascript

J

jpaul

Hi I am very new to this two

If the browser disable the javascript, what happen to Ajax? can i slove
the problem by using server side script? any suggestion for this?

i currently do some dirty projects with perl/cgi, and I would like to
add more client side features which relate to ajax, and do some
validation on the client side with javascript. but it is possible that
the javascript may be disable with some browsers. what can i do if the
client's broweer disable the javascript.

thank you
 
I

Ian Collins

jpaul said:
Hi I am very new to this two

If the browser disable the javascript, what happen to Ajax? can i slove
the problem by using server side script? any suggestion for this?
You're SOL if JavaScript is disabled.
i currently do some dirty projects with perl/cgi, and I would like to
add more client side features which relate to ajax, and do some
validation on the client side with javascript. but it is possible that
the javascript may be disable with some browsers. what can i do if the
client's broweer disable the javascript.
Fall back to conventional server side processing.
 
D

David Dorward

jpaul said:
If the browser disable the javascript, what happen to Ajax?

Ajax is a buzzword that basically means "Using JavaScript to make
requests to the server and process the response".

If JavaScript is disabled you can't use it to make such requests.
can i slove the problem by using server side script?

That depends what the problem is. Ajax is just a technology. It might
be used in a solution to a problem, but it isn't a solution in and of
itself.
i currently do some dirty projects with perl/cgi, and I would like to
add more client side features which relate to ajax, and do some
validation on the client side with javascript.

Never ever depend on the client to ensure data integrity / sanity. You
are effectively asking the user to police themselves. By all means use
it as a convienience to the user, but check the data again when it gets
to the server.
but it is possible that the javascript may be disable with some browsers.
what can i do if the client's broweer disable the javascript.

If its fluff, just forget about it, the user will get a slightly less
nice experience (well, depending on the fluff, sometimes things work
better without the JS).

If it does something useful, have a server side fallback.
 
J

jpaul

I usually code javascript which embed in Html form before I call the
server side script, I do all the validation in client side before it
goes to Server side. But it isn't possible for me to know if the client
already disable javascript. What method should I use to check for
browser and javascript, so incase I will not send the Html form with
Javascript that can not run in the client? The answer that I already
think off is, using server side script to check and if the client isn't
disable the javascript, then print the html form with javascript embed,
else I should use all the server side script.
 
D

Dylan Parry

Pondering the eternal question of "Hobnobs or Rich Tea?", jpaul finally
proclaimed:
I do all the validation in client side before it goes to Server side.
But it isn't possible for me to know if the client already disable
javascript.

I'd just have the server-side scripting re-validate the user input
anyway. That way people with Javascript support will have their input
validated quickly without them having to wait for the server to respond,
but as a fall back users without scripting enabled will still have their
input validated, but in a slightly longer process.

I wouldn't waste time trying to figure out whether the client supports
scripting or not, and sending different pages. That's just counter
productive.
 
T

The Magpie

jpaul said:
Hi I am very new to this two

If the browser disable the javascript, what happen to Ajax? can i slove
the problem by using server side script? any suggestion for this?
Simple answer: AJAX stands for "Asynchronous Javascript and XML".
Therefore, without Javascript there can be no AJAX.
 
R

Rich

Pondering the eternal question of "Hobnobs or Rich Tea?", jpaul finally
proclaimed:


I'd just have the server-side scripting re-validate the user input
anyway. That way people with Javascript support will have their input
validated quickly without them having to wait for the server to respond,
but as a fall back users without scripting enabled will still have their
input validated, but in a slightly longer process.

I wouldn't waste time trying to figure out whether the client supports
scripting or not, and sending different pages. That's just counter
productive.

As a task of getting a project complete it can be counter productive, but as an
end result the javascript validation can make the experience more polished and
professional if done right.

Client-side validation can make the experience a little prettier for folks that
have javascript enabled, but in either case I would not rely on the submitted
data itself. It's pretty easy to bypass javascript form validation, so you
always want to error check it on the server before doing anything with the
submitted data.

Rich
 
D

David Dorward

As a task of getting a project complete it can be counter productive, but
as an end result the javascript validation can make the experience more
polished and professional if done right.

So? Write one page that degrades gracefully if JavaScript isn't supported.
 

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,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top