1. Technology

Problem Solving

No matter whether you are a beginner or an expert with Javascript programming you will have scripts that don't work. Here is some information to help you solve those problems.

Asking for Help
The best way to ask for help when you have a Javascript problem

What Javascript Cannot Do
There are a few things that the Javascript programming language does not let you do

Common Javascript Errors
Commonly made Javascript errors and how to find them

My Script Doesn't Work
The first step in working out why a script doesn't work is to determine if the problem is in the script itself or is a conflict with something else in the page.

Plain Text Please
Javascript needs to be saved as plain text if you want it to work

Debugging Javascript
Different browsers provide different options for locating Javascript errors.

The JavaScript Debugging Console
All but one of the popular browsers have a built in JavaScript debugger and the one exception can be easily modified to add one.

The Bad Parts of JavaScript
There are some constructs allowed in JavaScript where you just make things more difficult for yourself if you use them.

Javascript and the Browser
Javascript has limited access to the browser and no access outside it but everyone is always asking how to change that.

Condition and Assignment Error Handling
We can reduce the number of run time errors in our JavaScript by testing if fields exist before we try to use them. There are some really simple ways we can modify our code to do this.

Faster Loading Web Pages
A minor modification to the way we attach our JavaScript to the web page can make the web page load much faster for at least some of our visitors.

Validate Your HTML
Invalid HTML can stop JavaScript working in some browsers.

Onload and the DOM
A frequent cause of "object not found" errors is due to scripts that try to access elements in the web page before those elements have been loaded.

Combining onloads
Having multiple onload assignments in a page means only the last one will work. Here's an easy way to amend the code so they all work.

The Scope of Variables
JavaScript variables have a different scope from what you would expect from other programming languages.

Semicolons and JavaScript
With JavaScript allowing you to leave out the semicolons on the end of statements you can end up with what you think is a single statement which JavaScript thinks is two separate statements or vice versa.

JavaScript Arrays That Are Not Arrays
There are many objects in JavaScript that are similar to arrays but which are not actually arrays. Even JavaScript arrays don't work the way arrays do in other languages.

The JavaScript Modulo Bug
The modulo operator in JavaScript does not return the correct value for negative numbers.

Using Anonymous Functions to Bypass IE Name Bug
JScript insists on sticking a whole lot of variables into the global namespace that JavaScript doesn't. This is a possible cause for why JScript might not run as JavaScript or vice versa. You can avoid this field name clash completely using anonymous functions and get your code so it works the same in both JScript and JavaScript.

Polymorphic JavaScript Functions
Accidentally giving two functions the same name in JavaScript can cause problems for many beginners. Deliberately giving two functions the same name is a simple way of improving the efficiency of a lot of scripts.

JavaScript Encryption
This 6.6k real encryption algorithm written in JavaScript is almost small enough to make effective encryption using JavaScript possible. (Note that this still doesn't prevent people accessing the decrypted version of web page content once the page displays).

JavaScript Hashing
One way encryption is possible with JavaScript, it is just not very useful.

Effective Web Page Encryption
Effective Web Page Encryption - there is no such thing

Password Hashing
Does hashing the password before sending it to the server it make the data transmission more secure?

min-width and max-width in Internet Explorer 6
Internet Explorer 6 doesn't understand the min-width and max-width stylesheet attributes. By adding a proprietary stylesheet command and a few lines of JScript we can rectify this lack and get IE6 to behave the same way as the more standards compliant browsers do.

Single Radio Buttons
How to handle single radio buttons and unselecting radio buttons

©2014 About.com. All rights reserved.