Required Fields
Sunday July 31, 2011
HTML5 defines a "required" attribute that can be added to form fields where we want to require that something be entered. We don't have to wait for browsers to implement ... Read More
Semicolons and JavaScript
Saturday July 30, 2011
The semicolons on the end of each statement are optional in JavaScript provided that they would be the last character on a line. Unfortunately, since JavaScript allows statements to be ... Read More
Getting Rid of document.write
Friday July 29, 2011
The document.write statement was a big part of being able to use JavaScript to update web pages back when JavaScript was first created. Modern web browsers provide much better less ... Read More
The Bad Parts of JavaScript
Thursday July 28, 2011
JavaScript includes a number of constructs that have either been superseded by something better or which seemed like a good idea to those who created JavaScript in the first place ... Read More
Set Attributes
Wednesday July 27, 2011
Our next DOM "JavaScript By Example" shows that we can not only read from the DOM but can also update the DOM from within JavaScript. We'll start with the simplest ... Read More
Get Styles
Tuesday July 26, 2011
In this eleventh DOM "JavaScript By Example" we look at how we can get more from the current element than just its attributes. We can also get the styles associated ... Read More
Get Attributes
Monday July 25, 2011
Now that we have gone through nine examples of how to access the DOM, we need to next move on to how we can actually access the information associated with ... Read More
Unobtrusive Error Handling
Sunday July 24, 2011
When we validate our form using JavaScript we ideally want an unobtrusive way of displaying error messages (in that we don't want to break the page for those without JavaScript). ... Read More
Plain Text Please
Saturday July 23, 2011
One problem that a lot of people who are new to JavaScript have when following the instructions on how to copy someone's script onto their site is that they use ... Read More
The Three Parts of JavaScript
Friday July 22, 2011
JavaScript can be divided into three parts. Different sets of standards apply to each of the three parts of JavaScript and support for the given standards for each part can ... Read More
What Does JavaScript Look Like?
Thursday July 21, 2011
JavaScript is a regular part of web pages. In addition it is an interpreted language. What does this all mean? Well what it means is that you can see for ... Read More
Singletons
Wednesday July 20, 2011
JavaScript doesn't have classes so all objects are really singletons anyway. We can however make an object behave even more like singletons in other languages do.
In the twenty first tutorial ... Read More
Walk The DOM Node By Node
Tuesday July 19, 2011
By combining the next sibling and child node calls we can set up code that will allow us to step through the entire HTML document one node at a time.
Walk ... Read More
Get Child Nodes
Monday July 18, 2011
As well as moving up the document tree, JavaScript also allows us to move down. Unlike the next sibling, previous sibling, and parent options though which return a single node, ... Read More
Get Parent Node
Sunday July 17, 2011
As well as being able to move between nodes at the same level within the web page, JavaScript also allows us to move up the ocument object model and get ... Read More
How to Attach JavaScript into Your Page
Saturday July 16, 2011
JavaScript used to be added all over the place in web pages making a jumbled mess. Not any more. The best way to add JavaScript is to keep it completely ... Read More
Moving JavaScript out of the Web Page
Friday July 15, 2011
Your web pages will be far easier to maintain if you can keep your HTML and JavaScript completely separate. The problem though is that not everyone knows how to take ... Read More
Can JavaScript Close This Window?
Thursday July 14, 2011
JavaScript can tell whether the current page is in a window opened by JavaScript. That is useful because JavaScript can only close windows (and tabs) that were opened by JavaScript. ... Read More
Chaining Methods
Wednesday July 13, 2011
In the twentieth tutorial on Object Oriented JavaScript we look at something you can do with the methods that actually don't need to return a value in order to make ... Read More
Get Previous Node
Tuesday July 12, 2011
The JavaScript DOM provides a lot of flexibility in navigating the web page. As well as being able to step forward to the next node on the same level, we ... Read More
Get Next Node
Monday July 11, 2011
JavaScript isn't just limited to searching the entire web page for a specific node or nodelist. Once you actually have a node you can navigate from there to the nodes ... Read More
Individual Field Validations
Sunday July 10, 2011
The next step after unobtrusively attaching JavaScript validation to a form field is to add code so that theit knows what field to validate. We can do this without hard ... Read More
Password Fields
Saturday July 9, 2011
Placing default text in the fields in your form to describe what is supposed to be entered there is one way of making your form easier to use. You just ... Read More
Budget Calculator Generator
Friday July 8, 2011
Create your own unique budget calculator complete with JavaScript validation. Budget calculators are fairly simple scripts since all they have to do is add and subtract a few numbers. Where ... Read More
Password Generator
Thursday July 7, 2011
Generate passwords to your specifications with the JavaScript password generator. You choose a length (between 7 and 20 characters) and the types of characters that the password must start with ... Read More
Public Access to Private Methods
Wednesday July 6, 2011
Defining private methods in JavaScript makes sure that they don't get overridden.
In this nineteenth object oriented tutorial we look at how you can make a private method accessible from outside ... Read More
Get Nodes For A Class
Tuesday July 5, 2011
Perhaps the most useful nodelist to grab from the web page are all the elements having a particular class attached. In this fourth DOM "JavaScript By Example" we look at ... Read More
Attaching Validation To A Form
Monday July 4, 2011
Modern JavaScript does not require that we clutter forms with event handlers in order to attach client side validation. Instead we can use event listeners within the JavaScript code itself ... Read More
Null and Undefined
Sunday July 3, 2011
These two JavaScript objects behave somewhat differently from all of the other JavaScript objects.
Null and Undefined
JavaScript Encryption
Saturday July 2, 2011
Many of the more knowledgeable JavaScript programmers claim that truly hiding your page source so that only those with the right password can access your page is impossible but they ... Read More
JavaScript Hashing
Friday July 1, 2011
One way encryption (or hashing) is possible with JavaScript. You can use MD5 or SHA1 encryption, it is just not very useful since your visitors can always modify the JavaScript ... Read More
