George, Julie, Michael, Moxie & Hank
www.georgejaros.com

Visitors: 791093 Info
Since Feb 5, 2006
Copyright © 2010 GJJ
George's Universe v6
>

Blog Archives - June 2006

Thursday, June 29, 2006 - JavaScript parseInt() Bug

While working on a site yesterday we came across an interesting bug in JavaScript that I thought it would be good to share.

The bug is with the parseInt() function that is supposed to convert a string to an integer, like this: parseInt("01")

For most strings this works fine, but both parseInt("08") and parseInt("09") for some reason return 0 (zero) instead of 8 and 9.

We ran across this while working on the expiration month of a credit card field:

<select name="selMonth0">
	<option value="">Month</option>
	<option value="01">01</option>
	<option value="02">02</option>
	<option value="03">03</option>
	<option value="04">04</option>
	<option value="05">05</option>
	<option value="06">06</option>
	<option value="07">07</option>
	<option value="08">08</option>
	<option value="09">09</option>
	<option value="10">10</option>
	<option value="11">11</option>
	<option value="12">12</option>
</select>

If August or September were selected we got an error saying the expiration date had to be in the future, because the month was being calculated as 0 instead of 8.

One fix is to remove the leading zeros from the option values, but we did find another fix that is probably a better solution:

parseInt(parseFloat(string))

parseFloat("08") converts the 08 to a floating number correctly. Then parseInt converts it to an integer correctly.

Here is a link with more information on the problem and solution: parseInt() Bug

0 Comments
Post Comment:
Author:
Email:
NOTE: Your email address will be encrypted to protect it from being harvested by SPAM Bots. See how I do this...
WWW:
Location:
Subject:
Message:
Date: Sep 7, 2010
Code:
W4BM3B
Key:
Enter the characters displayed above. I can't read the characters...

Privacy Policy

Tuesday, June 27, 2006 - 26 Week Ultrasound

We had yet another ultrasound today. The baby is doing great! We got some pretty clear pictures of the baby's face and got to see it kicking, stretching, and turning around. We even got to see it practicing suckling!

You can click on the ultrasound picture or HERE to see larger versions.

We've been feeling the baby move pretty consistently now. We can even see Julie's stomach move when baby's especially active. If Julie puts a cold soda on her belly the baby will kick at it! It's really fascinating to see!

0 Comments
Post Comment:
Author:
Email:
NOTE: Your email address will be encrypted to protect it from being harvested by SPAM Bots. See how I do this...
WWW:
Location:
Subject:
Message:
Date: Sep 7, 2010
Code:
JGRQA1
Key:
Enter the characters displayed above. I can't read the characters...

Privacy Policy

Sunday, June 25, 2006 - Updated Development Section

I just wanted to post that I've updated the Development section of my web site. I've split up the pages for ColdFusion, JavaScript, and Web Tips into three separate pages. I've also added two pages for Flash animations/programs that I've written and Other Apps that I've written. Enjoy!

0 Comments
Post Comment:
Author:
Email:
NOTE: Your email address will be encrypted to protect it from being harvested by SPAM Bots. See how I do this...
WWW:
Location:
Subject:
Message:
Date: Sep 7, 2010
Code:
597K3A
Key:
Enter the characters displayed above. I can't read the characters...

Privacy Policy

Wednesday, June 21, 2006 - Still kickin'

I know, I know. I said I'd do my best to keep my posts up to date and now I've skipped nearly a month. Sorry... I've been pretty busy the last few weeks. I've been spending a lot of time working with the neighborhood on the issue with the Townhouses and then last weekend Julie and I went on a short vacation.

We didn't go anywhere too exciting, just a chance to get away. We went to Saugatuck, Michigan and stayed at The Kingsley House Bed & Breakfast in nearby Fennville, MI. The food there was excellent, and aside from having to use a shub (shower/tub) to get clean the place was very nice. And Julie had a special breakfast cooked for her each morning without anything she's allergic to. In all, our stay was very nice, but I think we liked Door County better. I added a Photo Gallery with some of the pictures we took.

And through it all the baby has been active and kicking!

0 Comments
Post Comment:
Author:
Email:
NOTE: Your email address will be encrypted to protect it from being harvested by SPAM Bots. See how I do this...
WWW:
Location:
Subject:
Message:
Date: Sep 7, 2010
Code:
KH4VPA
Key:
Enter the characters displayed above. I can't read the characters...

Privacy Policy

download aim  |   IM Me send me an instant message  |   add me to your buddy list  |   add remote to your page  |   download aol instant messenger

Valid CSS!   Valid HTML 4.01 Transitional   Cynthia Tested!   eXTReMe Tracker
Geocaching profile for gjaros
SaveSURGE.org


Google  
       


Browser: CCBot/1.0 (+http://www.commoncrawl.org/bot.html)   |   IP: 38.107.191.111   |   All Agents
<<    <    September 2010    >    >>
SU MO TU WE TH FR SA
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
 Today:  Tuesday, September 07, 2010
 Time:  02:22:42 AM CST
 Go to: 

DeKalb, IL

Fair 72°F
Fair Feels like 72°F


UV index: 0 Low
Dew Point: 55°F
Humidity: 54%
Visibility: 10.0 mi
Pressure: 29.79 in (steady)
Wind: From the SSW at 16 mph

As reported at De Kalb, IL,
on Tuesday, September 7, 2010,
at 12:25 AM local time
Data provided by weather.com
View the 5 Day Forecast









Select a RSS Feed:
CNN.com CNN.com
CNN.com delivers up-to-the-minute news and information on the latest top stories, weather, entertainment, politics and more.


Paper: Van der Sloot admits to Holloway extortion
Joran van der Sloot admitted to a Dutch newspaper that he extorted money from the family of Natalee Holloway, the Alabama teen who disappeared in Aruba.

Date: Mon, 06 Sep 2010 16:40:47 EDT

Help sought after spy found dead in bag
Police asked for help in last month's death of a man who worked for British intelligence and whose naked body was found in a padlocked duffel bag in his bathroom.

Date: Mon, 06 Sep 2010 12:20:43 EDT

Obama's economic push too little, late?
President Obama rolls out an economic plan this week, but his fellow Democrats are confronting a difficult question: Is it too little, too late?

Date: Mon, 06 Sep 2010 17:50:45 EDT

Petraeus warns against burning Qurans
The U.S. commander in Afghanistan criticized a Florida church's plan to burn copies of the Quran on September 11, warning that it could endanger American troops.

Date: Mon, 06 Sep 2010 18:16:09 EDT

Mexico: Gunmen behind massacre ID'd
Six of the suspected gunmen responsible for the killings of 72 migrants in Mexico have been identified, Mexican authorities said Monday, the state-run Notimex news agency reported.

Date: Mon, 06 Sep 2010 21:44:14 EDT

Winds fuel Colo., Okla., fires
High winds helped fuel fast-moving wildfires in Colorado and Oklahoma on Monday, prompting evacuations in both states, officials said.

Date: Mon, 06 Sep 2010 22:58:06 EDT

'Little Rock Nine' member dies
Jefferson Thomas was risking his well-being by leaving an African-American school for Little Rock's all-white Central High School with eight other students in 1957.

Date: Mon, 06 Sep 2010 21:05:06 EDT

Magic shrooms may help dying patients
Terminally ill cancer patients struggling with anxiety may get some relief from a guided "trip" on the hallucinogenic drug psilocybin, a new study suggests.

Date: Mon, 06 Sep 2010 20:47:10 EDT

Ex-ELO cellist dies in hay-bale collision
A former cellist with the rock group Electric Light Orchestra was killed in southwestern England on Monday in a car crash involving a large bale of hay, local police said.

Date: Mon, 06 Sep 2010 13:07:04 EDT

'Vicious thugs' kill pizza delivery man
Boston police have arrested three suspects who they say stabbed a Domino's pizza delivery man and drove off in his car.

Date: Mon, 06 Sep 2010 18:38:50 EDT

© 2010 Cable News Network LP, LLLP.