Tip Details Add a Related Tip

Rate as: Positive Negative

Declaring variables in Javascript

If you are developing Javascript and you don't use Internet Explorer as your browser during development, make certain that you declare all of your variables using "var". In Firefox, Safari, and most other browsers, using variables in Javascript will *not* result in an error. But in Internet Explorer, if you use or set a variable that has not been declared, you will get an error message and your script will not run.
Rating: 100% positive, 1 Vote
Categories: javascript web
Added: on Aug 16, 2007 at 9:54 am
Added By: an anonymous user

Comments on this Tip

Add a Comment
I've run into this before... very annoying.
– Added by an anonymous user on Aug 17, 2007 at 8:08 am
Your Comment:
(how to format)
Rate This Tip:

Verify Humanity:
Sorry, we know it's annoying, but please enter the characters shown in the image to the left so that we know you're an actual person and not an evil spammer. Thanks.
       

Related Tips

Static variables in Javascript

100% positive, 3 comments - last added on Aug 15, 2008 at 10:42 am
– Tip added by an anonymous user on Aug 03, 2007 at 4:19 pm

Scrolling HTML elements using the keyboard

100% positive, 1 comment - last added on Jul 18, 2008 at 3:53 pm
– Tip added by rlansky on Jun 22, 2007 at 9:34 am

Enabling right click on web pages

Categories: javascript web security
100% positive, 0 comments
– Tip added by an anonymous user on Jul 19, 2008 at 6:37 am

Telling when an iframe is done loading

100% positive, 0 comments
– Tip added by an anonymous user on Apr 18, 2008 at 8:05 am

getting rounded corners without using background images

100% positive, 0 comments
– Tip added by tipstr on Mar 13, 2007 at 10:35 am

Viewing CSS and Javascript files

100% positive, 0 comments
– Tip added by an anonymous user on Aug 20, 2008 at 7:27 am

Optional parameters in javascript functions

100% positive, 0 comments
– Tip added by an anonymous user on Jul 30, 2008 at 10:44 am

Detecting if a variable exists in Javascript

100% positive, 0 comments
– Tip added by an anonymous user on Jul 22, 2008 at 8:31 am

compressing javascript

100% positive, 0 comments
– Tip added by an anonymous user on Jun 12, 2008 at 3:02 pm

Wrap web text to any shape

100% positive, 0 comments
– Tip added by an anonymous user on Dec 16, 2007 at 10:35 am

Javascript variable naming

100% positive, 1 comment - last added on Jul 22, 2008 at 8:33 am
– Tip added by an anonymous user on Sep 30, 2007 at 7:28 am

Creating vector graphics in javascript

100% positive, 0 comments
– Tip added by Marcos84 on May 10, 2007 at 2:44 pm

attaching events to nodes in Javascript

no ratings, 0 comments
– Tip added by an anonymous user on Aug 18, 2008 at 11:23 am

animating elements with jQuery

no ratings, 0 comments
– Tip added by an anonymous user on Aug 04, 2008 at 1:46 pm

Don't use onChange events for checkboxes

Categories: HTML DOM javascript web
no ratings, 0 comments
– Tip added by an anonymous user on Oct 01, 2007 at 4:01 pm

Code for creating Javascript CSS charts

no ratings, 0 comments
– Tip added by an anonymous user on Aug 21, 2007 at 12:23 pm

Efficient building of large strings in Javascript

no ratings, 0 comments
– Tip added by an anonymous user on Aug 08, 2007 at 12:52 pm

Avoid invalid title names when opening javascript windows

no ratings, 0 comments
– Tip added by an anonymous user on Aug 07, 2007 at 9:36 am

Nice article on javascript techniques

no ratings, 0 comments
– Tip added by rlansky on Apr 24, 2007 at 8:12 am

Learn By Doing

100% positive, 0 comments
– Tip added by an anonymous user 4 days, 18 hours ago