Results 1 to 10 of 10

Thread: Using asp to detect javascript and cookies

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    Well, you can check if Coockies are enabled with the same method you used the JavaScript ... try to write a coockie and try to read from it, if it worked ---> coockies enabled if not then no.

    I don't know of any way to check if JavaScript is enabled or not.

    You have to remember ASP is server side, so it has its limitations as far as information about the user..

    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  2. #2
    Lively Member
    Join Date
    May 1999
    Posts
    89
    I thought it wouldnt be possiable to check for javascript,i need to verify it because all the validations are done on the client side. thought it would save resources and be more effiecent. thanks for the help.

    Scott

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    Welcome, sorry for not being able to help more ...

    You can do all the checks using ASP ..

    if you think it is a good idea but not sure how, just say so, I will post you example code.
    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  4. #4
    Lively Member
    Join Date
    May 1999
    Posts
    89
    If you have code to check for javascript and cookies then by all means please post it.

    Thanks

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    I did some research for you ...

    this will get you ALL the things you need :



    http://www.cyscape.com/developer/wor...hcd2=968693273

    example for all the information you can get (including JavaScript !!!):

    http://www.cyscape.com/showbrow.asp

    cheers :-)
    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    Well, I just read some more about it ...
    It is NOT the cheapest way .. :-(

    I was trying to make a cookies test, but from some reason I always get the same results ...

    maybe someone else can help us sort it out ..

    <%
    dim theUID
    response.cookies ("Test") = "12345"
    %>

    <html>
    <head>
    <title>cookcies</title>
    </head>

    <body>
    <%
    theUID=""
    theUID=request.cookies ("Test")
    if theUID<>"12345" then
    response.write "cookies disabled"
    else
    response.write "Cookies enabled"
    end if
    %>
    </body>
    </html>

    from some reason I get the Coockie enabled everytime (even if I have cookies disabled ..

    Help !

    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  7. #7
    Addicted Member
    Join Date
    May 2000
    Location
    Grand Rapids, MI
    Posts
    231
    Well with ASP you can check ServerVariables to see what kind of browser is contacting you and based on this information you can know if the browser is Javascript capable, I belive the proper command to figure this out is:

    Code:
    Request.ServerVariables("HTTP_USER_AGENT")
    
    using this can also be a way to check to see if VBScript is capable by seeing if "MSIE" exist in the returned string. you cannot however determine if a certain feature is enabled or disabled just based on ServerVariables, it may be a good idea to warn the user ahead of time, and to also include 
    
    <Script language="javascript">
    <!--
    It's a good idea to use Comment blocks within script, any script capable browser, will ignore the comment, and process the script, any non-capable browser will ignore the script tags, but will also not show your code on the website because they're enclosed in <!-- -->
    -->
    </Script>
    -Karl Blessing aka kb244{fastHACK}
    [email protected]

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    Well,
    The thing is that the guy would like to know not only if the browser is capable, but also if it is ENABLED ...

    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  9. #9
    Addicted Member
    Join Date
    May 2000
    Location
    Grand Rapids, MI
    Posts
    231
    um asabi, were you not listening, I already mentioned concerns about if it's enabled or not, I didnt ignore that question now stop acting like we dont know what questions we're addressing.

    "you cannot however determine if a certain feature is enabled or disabled just based on ServerVariables, it may be a good idea to warn the user ahead of time...."
    -Karl Blessing aka kb244{fastHACK}
    [email protected]

  10. #10
    Lively Member
    Join Date
    May 1999
    Posts
    89
    Hey guys, thanks alot for all the code and the suggestions. I previously saw browserhawk but didnt really use all its capablities. Maybe ill consider getting it if it can detect javascript, cookies, browser type etc. In the mean time, i guess i can continue to use my method of cookies and javascript checking. Send a cookies using javascript and it it works boom javascript is enabled. Quick and dirty method.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width