By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,798 Members | 1,388 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,798 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Saqib Ali wrote:
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


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

Jul 20 '05 #2

P: n/a
Saqib Ali wrote:
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


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

Jul 20 '05 #3

P: n/a
Actually, Mozilla 1.5

Erwin Moller <si******************************************@spam yourself.com> wrote in message news:<40*********************@news.xs4all.nl>...
Saqib Ali wrote:

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

Jul 20 '05 #4

P: n/a
Saqib Ali wrote:
Actually, Mozilla 1.5


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
Jul 20 '05 #5

P: n/a
Erwin Moller wrote:
Saqib Ali wrote:

Actually, Mozilla 1.5

That is silly.


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.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #6

P: n/a
Randy Webb wrote:
Erwin Moller wrote:
Saqib Ali wrote:

Actually, Mozilla 1.5

That is silly.


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.

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
Jul 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.