GeeCON Prague 2014*
The moose likes HTML, CSS and JavaScript and the fly likes If JavaScript is disabled, how to listen events? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "If JavaScript is disabled, how to listen events?" Watch "If JavaScript is disabled, how to listen events?" New topic
Author

If JavaScript is disabled, how to listen events?

Aditya Singh
Ranch Hand

Joined: Mar 06, 2008
Posts: 62
hi,

If javaScript is disabled at client side, Can we use those event handler like onChange for list? If not then how to go about it?
Thanks.

reagards,
aditya
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

Please take the time to choose the correct forum for your posts. This forum is for questions on JSP.

For more information, please read this.

This post has been moved to a more appropriate forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

No JavaScript == no client-side event handling.

If it's important to you that your site still operate with JavaScript disabled, you must take the time and care to write the site such that it degrades gracefully when script is disabled. This is rather an art, and something that the adoption of "Unobtrusive JavaScript" can help with.

If JavaScript is essential for the operation of your site, you can simply tell people to enable JavaScript or go elsewhere.

While the latter may seem harsh, it's not an unreasonable approach to subscriber-based web applications where you can dictate system requirements for the application. For general Internet sites, the former is a more friendly approach.
[ September 02, 2008: Message edited by: Bear Bibeault ]
Hendy Setyo Mulyo
Ranch Hand

Joined: Dec 01, 2004
Posts: 219


hi,

If javaScript is disabled at client side, Can we use those event handler like onChange for list? If not then how to go about it?


Hi Aditya Singh,

Is there any particular reason why the JavaScript is disabled at client side?


Hendy Setyo Mulyo
SCJP 1.4 (95%), SCWCD 1.4 (94%)
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30596
    
154

Originally posted by Aditya Singh:
Can we use those event handler like onChange for list? If not then how to go about it?

What does "it" refer to? What are you trying to accomplish? You can't use event handlers if JavaScript is off, so "it" probably refers to your real requirement.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Aditya Singh
Ranch Hand

Joined: Mar 06, 2008
Posts: 62
Thankyou all, for reply.

"Requirement is, webpage behavior should not depend on Java script and processing should be done at server side"
[ September 03, 2008: Message edited by: Aditya Singh ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

In that case, pretty much the only events you can handle are link clicks and form submissions -- the semantic HTML events that cause a request to be sent to the server.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30596
    
154

Aditya,
"should not depend" is interesting wording. In particular, it doesn't sound like a ban on JavaScript. The phrasing sounds like you can do JavaScript validation - just not rely on it. This is common as you can do JavaScript validation as a convenience for those with it enabled and server validation for everyone.
Aditya Singh
Ranch Hand

Joined: Mar 06, 2008
Posts: 62
Thanks everyone for sharing your thought. We decided to use javaScript as without it client won't be interactive at all.
[ September 11, 2008: Message edited by: Aditya Singh ]
 
GeeCON Prague 2014
 
subject: If JavaScript is disabled, how to listen events?