WebGL uses GLGL ES (for mobile) instead of desktop GLSL. Most snippets of GLSL you find on the web are probably desktop GLSL. GLSL ES is actually a slightly different language with different features and functions available. You can't expect everything that works in desktop GLSL to work in GLSL ES.
The biggest change is in GLSL ES every single float requires a precision specifier: lowp, mediump or highp. For example, "mediump float x" instead of just "float x". In GLSL ES not providing a precision is an error, which is what you were seeing.
You can also put a precision statement at the top which sets the default precision for everything, as R0J0hound said, and that should set the precision for all variables beneath it (so you still need to specify precision for variables above it). That should fix the error, but it's bad practice: mobile devices are slowed down by using unnecessarily high precision. The effect template from the SDK has comments guiding the use of precision, roughly along the lines of:
lowp - for samplers, color and opacity values, which are expected to be in the range 0-1
mediump - for texture co-ordinates and where lowp is insufficient precision
highp - not usually necessary (and not actually always supported), but may be necessary when very high accuracy is required for some reason in an effect.
Never use "precision highp float", this is almost always wrong. Even "precision mediump float" will needlessly cause slowdown by making samplers and colors use higher precision than necessary.
Hope that helps you understand!