Why does <INPUT type="hidden"> slow my JavaScript down??

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

    Why does <INPUT type="hidden"> slow my JavaScript down??

    I have created a slider using Javascript and html tables that
    generally works very well.

    As you move the "knob" to the right, a numeric value in an adjactent
    <INPUT type="text"> tag increases. As you move the knob to the left,
    the numeric value decreases... just as it should. It works very smooth
    and seamlessly. Very responsive to the mouse's movement.


    Now, I would like to make this INPUT tag have type="hidden". But when
    I make that simple, one-word change and try it out, the resulting
    slider is VERY sluggish and unresponsive. The slider doesn't even come
    close to keeping up with the mouse.

    Does anyone know why this happens? I can't come up with any
    explanation.
    Is there a known work-around?

    Thanks
    -Saqib
  • Erwin Moller

    #2
    Re: Why does &lt;INPUT type=&quot;hidd en&quot;&gt; slow my JavaScript down??

    Saqib Ali wrote:
    [color=blue]
    > I have created a slider using Javascript and html tables that
    > generally works very well.
    >
    > As you move the "knob" to the right, a numeric value in an adjactent
    > <INPUT type="text"> tag increases. As you move the knob to the left,
    > the numeric value decreases... just as it should. It works very smooth
    > and seamlessly. Very responsive to the mouse's movement.
    >
    >
    > Now, I would like to make this INPUT tag have type="hidden". But when
    > I make that simple, one-word change and try it out, the resulting
    > slider is VERY sluggish and unresponsive. The slider doesn't even come
    > close to keeping up with the mouse.
    >
    > Does anyone know why this happens? I can't come up with any
    > explanation.
    > Is there a known work-around?
    >
    > Thanks
    > -Saqib[/color]

    Probably because of the use of a bad browser with poor javascript
    implementation. M$ IE by any chance?

    Comment

    • Brian Genisio

      #3
      Re: Why does &lt;INPUT type=&quot;hidd en&quot;&gt; slow my JavaScript down??

      Saqib Ali wrote:
      [color=blue]
      > I have created a slider using Javascript and html tables that
      > generally works very well.
      >
      > As you move the "knob" to the right, a numeric value in an adjactent
      > <INPUT type="text"> tag increases. As you move the knob to the left,
      > the numeric value decreases... just as it should. It works very smooth
      > and seamlessly. Very responsive to the mouse's movement.
      >
      >
      > Now, I would like to make this INPUT tag have type="hidden". But when
      > I make that simple, one-word change and try it out, the resulting
      > slider is VERY sluggish and unresponsive. The slider doesn't even come
      > close to keeping up with the mouse.
      >
      > Does anyone know why this happens? I can't come up with any
      > explanation.
      > Is there a known work-around?
      >
      > Thanks
      > -Saqib[/color]

      That is an implementation-specific issue. Why does it have to be an
      input hidden value that you change?

      Here is a simple work-around that should work for you on all JS
      capabable browsers...

      Try changing a global variable, instead of the hidden value. If you
      need it for form submittal, simply define the onSubmit method of the
      form, and assign the variable to the hidden input field, and away you go :)

      Brian

      Comment

      • Saqib Ali

        #4
        Re: Why does &lt;INPUT type=&quot;hidd en&quot;&gt; slow my JavaScript down??

        Actually, Mozilla 1.5

        Erwin Moller <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om> wrote in message news:<403393ff$ 0$573$e4fe514c@ news.xs4all.nl> ...[color=blue]
        > Saqib Ali wrote:
        >
        > Probably because of the use of a bad browser with poor javascript
        > implementation. M$ IE by any chance?[/color]

        Comment

        • Erwin Moller

          #5
          Re: Why does &lt;INPUT type=&quot;hidd en&quot;&gt; slow my JavaScript down??

          Saqib Ali wrote:
          [color=blue]
          > Actually, Mozilla 1.5
          >[/color]

          That is silly.
          I use Mozilla 1.4.1 and don't have that problem, but I couldn't check your
          code of course.
          If you want me to, post it.

          Good luck solving it.
          If you found a workaround or solution, let us know.

          Good luck!

          Regards,
          Erwin Moller

          Comment

          • Randy Webb

            #6
            Re: Why does &lt;INPUT type=&quot;hidd en&quot;&gt; slow my JavaScript down??

            Erwin Moller wrote:
            [color=blue]
            > Saqib Ali wrote:
            >
            >[color=green]
            >>Actually, Mozilla 1.5
            >>[/color]
            >
            >
            > That is silly.[/color]

            For the OP to post and say "Mozilla 1.5 displays this behavior" is
            "silly"??? Quite contrary. For you to post and say that its silly, when
            you have not tested what the OP is seeing, is beyond silly - its
            downright ignorant.



            --
            Randy
            Chance Favors The Prepared Mind
            comp.lang.javas cript FAQ - http://jibbering.com/faq/

            Comment

            • Erwin Moller

              #7
              Re: Why does &lt;INPUT type=&quot;hidd en&quot;&gt; slow my JavaScript down??

              Randy Webb wrote:
              [color=blue]
              > Erwin Moller wrote:
              >[color=green]
              >> Saqib Ali wrote:
              >>
              >>[color=darkred]
              >>>Actually, Mozilla 1.5
              >>>[/color]
              >>
              >>
              >> That is silly.[/color]
              >
              > For the OP to post and say "Mozilla 1.5 displays this behavior" is
              > "silly"??? Quite contrary. For you to post and say that its silly, when
              > you have not tested what the OP is seeing, is beyond silly - its
              > downright ignorant.[/color]


              Relax man, you are missing my intention/point, and start calling me names
              that would better describe yourself if you read this thread carefully.

              This is the situation:
              When Saqib Ali wrote he was having slow Javascript when updating hidden
              fields, I checked that on my own browser (Mozilla 1.4.1) by making a small
              program that does just that.
              I didn't notice any slow performance.
              So I asked if Saqib Ali was using a broken browser, like IE which is known
              for it strange non-standard Javascript behaviour.

              He wrote he was using Mozilla 1.5.

              So I responded that was silly.
              Silly that I was using Mozilla too (and a close version).
              Not the fact that he uses Mozilla, which I do too.

              Erwin

              Comment

              Working...