check if javascript is disabled

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Diego

    check if javascript is disabled

    Hi

    My question is if exists any way to check if javascript is disabled
    on the client browser, I have tried with browser.javascr ipt but this
    only return to me if the browser has the capability, no if is disabled.

    Thanks Diego
  • Ignacio Machin \( .NET/ C#  MVP \)

    #2
    Re: check if javascript is disabled

    Hi,

    Frankly I don't know any method of doing it quering the variables provided
    by the browser, A possible workaround would be to have a hidden field whose
    value is set from javascript, when you get the page back if that hidden
    field does not have the expected value then you know javascript is not
    actived.


    cheers,

    --
    Ignacio Machin,
    ignacio.machin AT dot.state.fl.us
    Florida Department Of Transportation



    "Diego" <Diego@discussi ons.microsoft.c om> wrote in message
    news:6A62E3E7-1AD0-4A09-9D12-F476D615799B@mi crosoft.com...[color=blue]
    > Hi
    >
    > My question is if exists any way to check if javascript is disabled
    > on the client browser, I have tried with browser.javascr ipt but this
    > only return to me if the browser has the capability, no if is disabled.
    >
    > Thanks Diego[/color]


    Comment

    • Diego

      #3
      Re: check if javascript is disabled

      Thanks Ignacio
      but the problem is that I have to know that in a HttpModule
      the other way is to use your solution in a page that execute and redirect to
      the home, but the site have to work entering by other pages than home


      "Ignacio Machin ( .NET/ C# MVP )" wrote:
      [color=blue]
      > Hi,
      >
      > Frankly I don't know any method of doing it quering the variables provided
      > by the browser, A possible workaround would be to have a hidden field whose
      > value is set from javascript, when you get the page back if that hidden
      > field does not have the expected value then you know javascript is not
      > actived.
      >
      >
      > cheers,
      >
      > --
      > Ignacio Machin,
      > ignacio.machin AT dot.state.fl.us
      > Florida Department Of Transportation
      >
      >
      >
      > "Diego" <Diego@discussi ons.microsoft.c om> wrote in message
      > news:6A62E3E7-1AD0-4A09-9D12-F476D615799B@mi crosoft.com...[color=green]
      > > Hi
      > >
      > > My question is if exists any way to check if javascript is disabled
      > > on the client browser, I have tried with browser.javascr ipt but this
      > > only return to me if the browser has the capability, no if is disabled.
      > >
      > > Thanks Diego[/color]
      >
      >
      >[/color]

      Comment

      • Dmitriy Lapshin [C# / .NET MVP]

        #4
        Re: check if javascript is disabled

        Hi,

        The only specific way I can think of is to somehow utilize the <NOSCRIPT>
        tag.

        --
        Sincerely,
        Dmitriy Lapshin [C# / .NET MVP]
        Bring the power of unit testing to the VS .NET IDE today!


        "Diego" <Diego@discussi ons.microsoft.c om> wrote in message
        news:6A62E3E7-1AD0-4A09-9D12-F476D615799B@mi crosoft.com...[color=blue]
        > Hi
        >
        > My question is if exists any way to check if javascript is disabled
        > on the client browser, I have tried with browser.javascr ipt but this
        > only return to me if the browser has the capability, no if is disabled.
        >
        > Thanks Diego[/color]

        Comment

        • Ignacio Machin \( .NET/ C#  MVP \)

          #5
          Re: check if javascript is disabled

          Hi,

          You only needs to do this check once, after that you can store it in
          session.

          I really don't think this is possible without using something like I
          mentioned before or the redirect.
          You could google for this, this probably is a problem that all server side
          framework may have, so you could look for it in ASP/PHP/CFM groups


          cheers,

          --
          Ignacio Machin,
          ignacio.machin AT dot.state.fl.us
          Florida Department Of Transportation


          Pd:
          If you find the answer post it back here, for the archives :)

          "Diego" <Diego@discussi ons.microsoft.c om> wrote in message
          news:10562B64-8D0A-4C78-9EA9-AA57689A1F10@mi crosoft.com...[color=blue]
          > Thanks Ignacio
          > but the problem is that I have to know that in a HttpModule
          > the other way is to use your solution in a page that execute and redirect
          > to
          > the home, but the site have to work entering by other pages than home
          >
          >
          > "Ignacio Machin ( .NET/ C# MVP )" wrote:
          >[color=green]
          >> Hi,
          >>
          >> Frankly I don't know any method of doing it quering the variables
          >> provided
          >> by the browser, A possible workaround would be to have a hidden field
          >> whose
          >> value is set from javascript, when you get the page back if that hidden
          >> field does not have the expected value then you know javascript is not
          >> actived.
          >>
          >>
          >> cheers,
          >>
          >> --
          >> Ignacio Machin,
          >> ignacio.machin AT dot.state.fl.us
          >> Florida Department Of Transportation
          >>
          >>
          >>
          >> "Diego" <Diego@discussi ons.microsoft.c om> wrote in message
          >> news:6A62E3E7-1AD0-4A09-9D12-F476D615799B@mi crosoft.com...[color=darkred]
          >> > Hi
          >> >
          >> > My question is if exists any way to check if javascript is disabled
          >> > on the client browser, I have tried with browser.javascr ipt but this
          >> > only return to me if the browser has the capability, no if is disabled.
          >> >
          >> > Thanks Diego[/color]
          >>
          >>
          >>[/color][/color]


          Comment

          • Nicole Calinoiu

            #6
            Re: check if javascript is disabled

            Diego,

            Assuming cookies are enabled, you could write to the document.cookie from
            client-side javascript. The javascript could be written into each page from
            your HttpModule. The biggest challenge would probably be handling the first
            request, where the cookie value has not yet been written. Of course, if you
            don't also require that cookies be enabled for your application, then this
            technique is useless.

            HTH,
            Nicole


            "Diego" <Diego@discussi ons.microsoft.c om> wrote in message
            news:10562B64-8D0A-4C78-9EA9-AA57689A1F10@mi crosoft.com...[color=blue]
            > Thanks Ignacio
            > but the problem is that I have to know that in a HttpModule
            > the other way is to use your solution in a page that execute and redirect
            > to
            > the home, but the site have to work entering by other pages than home
            >
            >
            > "Ignacio Machin ( .NET/ C# MVP )" wrote:
            >[color=green]
            >> Hi,
            >>
            >> Frankly I don't know any method of doing it quering the variables
            >> provided
            >> by the browser, A possible workaround would be to have a hidden field
            >> whose
            >> value is set from javascript, when you get the page back if that hidden
            >> field does not have the expected value then you know javascript is not
            >> actived.
            >>
            >>
            >> cheers,
            >>
            >> --
            >> Ignacio Machin,
            >> ignacio.machin AT dot.state.fl.us
            >> Florida Department Of Transportation
            >>
            >>
            >>
            >> "Diego" <Diego@discussi ons.microsoft.c om> wrote in message
            >> news:6A62E3E7-1AD0-4A09-9D12-F476D615799B@mi crosoft.com...[color=darkred]
            >> > Hi
            >> >
            >> > My question is if exists any way to check if javascript is disabled
            >> > on the client browser, I have tried with browser.javascr ipt but this
            >> > only return to me if the browser has the capability, no if is disabled.
            >> >
            >> > Thanks Diego[/color]
            >>
            >>
            >>[/color][/color]


            Comment

            • Mark

              #7
              Re: check if javascript is disabled

              Check out HttpBrowserCapa bilities.JavaSc ript in the System.Web namespace.

              hth.

              Mark


              "Diego" <Diego@discussi ons.microsoft.c om> wrote in message
              news:6A62E3E7-1AD0-4A09-9D12-F476D615799B@mi crosoft.com...[color=blue]
              > Hi
              >
              > My question is if exists any way to check if javascript is disabled
              > on the client browser, I have tried with browser.javascr ipt but this
              > only return to me if the browser has the capability, no if is disabled.
              >
              > Thanks Diego[/color]


              Comment

              • Daniel Jin

                #8
                Re: check if javascript is disabled

                that only tells you if it's supported, doesn't tell you if it's disabled.

                "Mark" wrote:
                [color=blue]
                > Check out HttpBrowserCapa bilities.JavaSc ript in the System.Web namespace.
                >
                > hth.
                >
                > Mark
                > www.dovetaildatabases.com
                >
                > "Diego" <Diego@discussi ons.microsoft.c om> wrote in message
                > news:6A62E3E7-1AD0-4A09-9D12-F476D615799B@mi crosoft.com...[color=green]
                > > Hi
                > >
                > > My question is if exists any way to check if javascript is disabled
                > > on the client browser, I have tried with browser.javascr ipt but this
                > > only return to me if the browser has the capability, no if is disabled.
                > >
                > > Thanks Diego[/color]
                >
                >
                >[/color]

                Comment

                Working...