Weird Thoughts From Eric's Head

Tags - Categories : All | AJAX | BUSINESS | PERSONAL | PROGRAMMING | BOOK REVIEW

Another Blonde Joke
A manager walks into his office and sees a blonde crying. He approaches her and asks why she's crying. She tells him she just found out her mother died. The manager tells her to go to take the rest of the day off and not to worry about work. Later, the manager calls the blonde to see how she's doing. The blonde is crying harder than before. He tries to console her, but he couldn't. The blonde says, "I was calling everyone to let them know about my mother's death and I found out something horrible." "What?" the manager replied. "I found out my sister''s mom died too!"

Chat Room Software
The other day I was doing my normal rounds on all of the forums I post on regularly. I came across a post on a chat room that was based on JavaScript and PHP.

The site is: http://www.qwadchat.com

I was quite impressed on how quick the response time was and how smooth it was working. The program is still in beta, but it is worth checking out if you want to add a small chat room to your web site.

I have suggested to the developer to make an option to allow for UBB-type of mark-up so it is more secure. The HTML mode is allowed and blocks all of the troublesome JavaScript events that could cause problems. BUT it still allows for HTML markup that can have BIG text in the display.

There is a demo room there and I hope you try playing with it. As time goes on it can only get better and the developer is planning to add more options that should make it easier to use.

Eric Pascarello
Moderator of HTML/JavaScript at www.JavaRanch.com
Author of: JavaScript: Your Visual Blueprint for Dynamic Web Pages


Hi all. Stupid question. I've just learned a little javascript, and I'm trying to incorporate it onto my home webpage experiment. The thing is, I've defined a variable as a value(integer) from a field, but as part of one of the functions, it is simply adding that value to the beggining of that next line of code in the function...
that was a poor explanation... 

{the value "kelv" is always a number}

kelv=document.form.field.value     
document.form.field8.value=kelv+273.15

/* produces kelv273.15  */

I'm sure there is a simple answer here, any help would be much appreciated.
thx
dasaven@yahoo.com

It is not a stupid question. The problem is a form element is seen as a string not a number. You need to convert it: <pre style="background-color:silver"> //Use when there can be a decimal number (XX.XXX) var yourNum = parseFloat(document.formName.elementName.value); //Use when the number is an integer (XXX) var yourNum = parseInt(document.formName.elementName.value); //This also works, but is bad practice var yourNum = (document.formName.elementName.value * 1); Eric Pascarello


Add a comment

Title
Body
HTML : b, i, blockquote, br, p, pre, a href="", ul, ol, li
Math Quiz 6 + 5 = (Helps stop blog spam)
Name
E-mail address
Website
Remember me Yes  No 

E-mail addresses are not publicly displayed, so please only leave your e-mail address if you would like to be notified when new comments are added to this blog entry (you can opt-out later).

TrackBack to http://radio.javaranch.com/pascarello/addTrackBack.action?entry=1108918117000