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

S

Saqib Ali

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
 
E

Erwin Moller

Saqib said:
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?
 
B

Brian Genisio

Saqib said:
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
 
E

Erwin Moller

Saqib said:
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
 
R

Randy Webb

Erwin said:
Saqib Ali wrote:




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.
 
E

Erwin Moller

Randy said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top