So you want to open a drop down select box without clicking on it? For years, people have been looking for the answer to this question. While everything else on the web has been changing since, the answer to this question remains the same. See the answer

If you deal with more than external JavaScript file on a web page, it is only a matter of time before you run into a problem with window.onload. If two scripts each use window.onload, then the first function gets overwritten by the second. Learn how to handle it here.

I often need to add events to an element inside a JavaScript loop. If you’ve ever done this before, you know that it wont work unless you change the syntax properly, the event will always fire on the last item in the loop. In this article I will show you the simple concept of using a closure around the event to make it work properly. See the closure.

Deleting an item from an array is easy using JavaScript’s built-in method splice(). However, if you are somewhat new to scripting, simply knowing about splice does not help you remove a certain item from an array. This article will solidly state the solution to this dilemma. Read How

Web developers have multiple options for redirecting/reloading pages using either a server-side scripting language, like PHP, or client-side JavaScript. In this article, I will discuss the options you have for ‘refreshing’ a page using PHP, and why that word is a slight bit misleading. See why.

When dealing with URLs in JavaScript, you will come across various syntax like location, window.location, or location.href, etc. Each piece of syntax has it use, and you will become a smarter developer by knowing the difference between them. In this article, I will show you how to correctly get the full URL with JavaScript. View the code.

I found a fascinating difference in the use of the dynamic script tag between Internet Exploder and all the other browsers. They call the remote script at different times. This might cause undesirable behaviors in your script. Read on.

I recently found myself working on a small script that needed to perform some actions upon submission of a form. We decided that this form may or may not have an existing event handlers. If I used the javascript form.onsubmit = function(e){ ... }, it would overwrite the first event. We researched various ways of making sure both events fired and that it worked across all the browsers. See how we add the event without overwriting the existing one.

JavaScript has two built in methods that are very similar in name and function- substring() and substr(). Developers and designers who also use server side languages may find it easy to mix them up, since methods like these have similar names across other languages. Either way, mixing them up might cause bugs with your scripts. For example, see the snippet below that looks almost identical, but yields different results.

Here are some cheat sheets for common Javascript string needs. Your choice of built-in methods or regular expressions. View the Code