Jscript numeric help 
Author Message
 Jscript numeric help

I've got a script with counter.
I use onclick event of a specific href istruction to count the access to a
specific page. I put the counter in a cookie. When a take back the counter
from the cookie it's no as integer but as a string, why?
So if a do:
if (ckclick('page1')<ckclick('page2'){true}else{false}
ckclick('page1') = '11'
ckclick('page2') = '3'
the result is: true.
But
ckclick('page1') = 11
ckclick('page2') = 3
so the result must be: false.

Chrys
All Comunity
    http://www.*-*-*.com/
SMS Cash

http://www.*-*-*.com/
desc=1
Beeps for Money
   ID=J33A9748E68
    http://www.*-*-*.com/

Chrys 's Web Page
http://www.*-*-*.com/
http://www.*-*-*.com/

Ricarica gratis 50 mila sul cellulare
http://www.*-*-*.com/



Sat, 17 May 2003 03:00:00 GMT  
 Jscript numeric help
Cookie values are parsed from
  document.cookie
which is a string. So use
  parseInt(clclick('page1'), 10)

Quote:

> I've got a script with counter.
> I use onclick event of a specific href istruction to count the access to a
> specific page. I put the counter in a cookie. When a take back the counter
> from the cookie it's no as integer but as a string, why?
> So if a do:
> if (ckclick('page1')<ckclick('page2'){true}else{false}
> ckclick('page1') = '11'
> ckclick('page2') = '3'
> the result is: true.
> But
> ckclick('page1') = 11
> ckclick('page2') = 3
> so the result must be: false.

> Chrys
> All Comunity
>    http://www.AllCommunity.com/all.members/chrysbj/
> SMS Cash

> http://www.smscash.it/index.php3?pagid=reg&p_form=P&p_pres=0&cpre=127...
> desc=1
> Beeps for Money
>    ID=J33A9748E68
>    http://www.matrixtlc.co.uk/beeps4money/index.html

> Chrys 's Web Page
> http://on.to/chrys-bj
> http://members.xoom.com/chrysagn

> Ricarica gratis 50 mila sul cellulare
> http://216.221.175.58/cgi-bin/affiliate/ad.cgi?id=chrys-bj

--

        Martin Honnen
        http://javascript.faqts.com/
        http://home.t-online.de/home/martin.honnen/jsgoddies.html



Sat, 17 May 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. trouble keeping numeric variables as numeric

2. Numeric Validation Problem

3. Numeric array problem

4. BUG: float numeric precision

5. float numeric precision

6. Validating A numeric Input in VB6

7. validate a numeric field

8. Limit Numeric Values to significant length

9. Accessing a character by its numeric code

10. Validation For Alpha vs. Numeric

11. convert a string as a numeric value

12. convert ip numeric to text

 

 
Powered by phpBB® Forum Software