• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Use of JavaScript

 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it reasonable to use JavaScript in a project where the client could have JavaScript turned off in his/her browser? How common is it for that
to happen? What would you use to avoid using JavaScript if that is an issue?

Thank you.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JavaScript should add to the user experience.

Eric
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In such "mixed environments" it's common to take one of two approaches:
  • write separate pages
  • employ Unobtrusive JavaScript

  • The first is obviously a pain in the butt, and very time/resource consuming.

    The latter is the better way to go but requires a great deal of finesse. In Unobtrusive JavaScript, no script is mixed in with the structural HTML, which is written so that it is functional in its own right. Then, in onload handlers (or jQuery's document-ready handler) the page is augmented with rich behaviors for those that have script enabled.

    Those with script disabled experience a clunky, old-fashioned interface doing only what's possible with links and forms. Those with script enabled get a rich UI.

    Neither approach is particularly easy or fun.

    I've been lucky in that I've worked on enterprise-level web applications where we have the luxury of telling the users to enable script or go elsewhere.
     
    Mary Taylor
    Ranch Hand
    Posts: 327
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I think I must avoid JavaScript then as I have no control over the user environment. Writing the pages to function without JavaScript has proved burdensome and virtually impossible; but you have suggested JSTL and EL so I will look there now.

    Thanks.
     
    author & internet detective
    Posts: 41860
    908
    Eclipse IDE VI Editor Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Mary Taylor wrote:but you have suggested JSTL and EL so I will look there now.


    Which make writing the JSP easier. They have no connection to JavaScript.

    If you give an example of what is hard to do without JavaScript, you may get more useful comments.

    Even if the user does have JavaScript turned on, you have to write server code assuming they tried to circumvent it.
     
    F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic