Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

If JavaScript is disabled, how to listen events?

 
Aditya Singh
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 219
Firefox Browser Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34378
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Aditya Singh
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34378
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic