July 8, 1997

How can I convert characters to ASCII values and vice versa?

Question: How can I convert characters to ASCII values and vice versa? Answer: There are no functions in JavaScript that make it easy to obtain ASCII values of characters and vice versa, but there are a couple of tricks that can be used to achieve the same effect. In the

reading input field numbers

Question:   Answer: JavaScript can be used to access values in web form input fields. This is possible because JavaScript treats input fields as objects with several properties. One of these properties is a string object called “value“. The question “How can I obtain input field numbers?” can be posed

Persistent Cookies with JavaScript

Question: How can I write a cookie in one page and then read that cookie in another? or alternatively pass data gathered in one page (not a remote!) and then access it in another? Answer: JavaScript programs have access to the “magic cookie jar” through a special property of the

undefined vs. null

Question:   Answer: You are probably familiar with a special value in JavaScript called null. This is a value you can assign to a variable when you want to indicate that the variable has no particular value. Well, kind-of. The fact is, null is a value, too — just like

Representing Numeric Values in US Currency Format

Question:   Answer: Many people have been asking how to do this. Since JavaScript does not have built-in methods for converting numbers to currency-formatted strings, the only option left is to make a function that does it for us — which I have already done for you. The name of