#1
  1. action=(isSleep())?sleep:code;
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Sydney->Indiana
    Posts
    182
    Rep Power
    15

    Using JSP to find scripting support ?


    I was wondering if there was a method using JSP or Java
    to find whether or not a client has scripting enabled.

    Currently I'm using:
    Code:
    <noscript>
    <h1>This page requires javascript to run</h1>
    <meta http-equiv="Refresh" content="0; URL=noJavascript.jsp" />
    </noscript>
    But it's clumsy, non-standard and it's possible to get around, if you're quick enough with the stop button.

    Im looking for some method along the lines of
    Code:
    <c:if test="${param.noScript}">
      <jsp:forward page="noJavaScript.jsp" />
    </c:if>
    But have no idea if such a parameter can be found, I've already gone through the request headers availabe in the pageContext, but can't find anything which indicates scripting support, any ideas would be great.

    Thanks,
    W
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    100
    Rep Power
    12
    I don't think there is a parameter within the HTTP HEADER that determines the scripting is enabled or disabled in a client(browser).
    You will have to rely on scripting itself
  4. #3
  5. action=(isSleep())?sleep:code;
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Sydney->Indiana
    Posts
    182
    Rep Power
    15
    Yeah, the obvious solution.
    All buttons which submit information are generated using javascript, this prevents non-javascript enabled browsers etc from submitting information which hasn't been javascript validated.

IMN logo majestic logo threadwatch logo seochat tools logo