Travel Solo But Never Alone
Find the right memory at MemorySuppliers.com!

Javascript - most recent to oldest updatedJavascript - most recent to oldest updated

Example scripts and howtos for Javascript

Javascript is a programming or scripting language primarily used for client-sided programming in web browsers. It can also be used as a server-side programming language but this is generally used less often. Javascript was originally created by Netscape for their browser Netscape Navigator, and is now an implementation of the ECMAScript standard. It is typically used in web browsers for form validation, floating navigation, AJAX and other nifty things to make web pages more interactive.

Post sort order: Post Date (Newest First) | Post Date (Oldest First) | Alphabetical | Date Updated

How to disable Javascript in Mozilla FirefoxHow to disable Javascript in Mozilla Firefox

Posted July 19th, 2008 in Applications and Javascript

Forms on websites are typically validated using Javascript on the client side to prevent additional round trips to the server if a form hasn't been completed correctly, and are then also validated on the server side. When testing a website you need to be able to test both so need to disable Javascript in your web browser to test the server side validation. This post looks at how to disable Javascript in the Mozilla Firefox web browser. The specific version the screenshots come from are Firefox 3 but it should be the same for earlier versions.

Read more »

How to check if a Javascript function existsHow to check if a Javascript function exists

Posted July 5th, 2008 in Javascript

Sometimes you might want to call a function in Javascript but check if the function exists before calling it. This is very simple and is covered in this post.

Read more »

Clearing the default value of text input with JavascriptClearing the default value of text input with Javascript

Posted June 17th, 2008 in Javascript

Often in a web form you will put a default value into a text box which explains what the box is for and when the user clicks into the box clear the value. An example of this is a sidewide search box where you might want to put the instructions (e.g. "enter your keywords here") in the box instead of as a title for the text input. This post looks at how to clear the value only if it is set to the default value with Javascript.

Read more »

Use normal href if Javascript is disabledUse normal href if Javascript is disabled

Posted June 12th, 2008 in Javascript

I saw a post on a bulletin board somewhere recently where the poster asked how to make the href work normally on a link like this <a href="javascript:;" onclick="dosomething()"> if Javascript is not enabled. It's actually quite simple and I will look at how to do this in this post.

Read more »

Which browsers support which versions of JavascriptWhich browsers support which versions of Javascript

Posted June 7th, 2008 in Javascript

As well as putting "javascript" as the language or type element of the <script> tag you can specify a version, for example javascript1.5. What this means is that browsers that do not support that version of Javascript will not run the code in that <script> block. I was interested to find out if this meant a simple way of determine which browser was being run with Javascript but as my findings in this post show it's not...

Read more »

swfobject "t has no properties" errorswfobject "t has no properties" error

Posted May 28th, 2008 in Javascript

I used swfobject 2.0 to insert a flash movie into a customer's website and it all worked nicely. I then moved the page it was on and it stopped working. This post looks at the error message I found ("t has no properties"), what I did wrong and what the solution was.

Read more »

Using Javascript to focus a form element onloadUsing Javascript to focus a form element onload

Posted January 5th, 2008 in Javascript

The Personalised Plates website has a big input box on every page for searching for available personalised plates. The page template uses the Javascript form element focus() function to set the focus on this text box when the page loads so the user can start to type in a personalised plate idea without having to click the box with their mouse.

Read more »

Assigning values to associative arrays in JavascriptAssigning values to associative arrays in Javascript

Posted December 30th, 2007 in Javascript

Javascript has zero indexed integer arrays and also associative arrays. They work in a similar manner but there is a useful way to be able to initialise an associative array with both keys and values in one call. This post will look at the way a zero based integer based array can be initialised and then the ways it can be done with associative arrays in Javascript.

Read more »

Testing if a Javascript variable is definedTesting if a Javascript variable is defined

Posted October 23rd, 2007 in Javascript (Updated October 23rd, 2007)

Sometimes in Javascript you need to be able to determine if a variable has already been defined before continuing with your script. It is very simple to do this using the typof operator.

Read more »