Introduction to JavaScript /
Cautions When Using JavaScript
Cautions When Using JavaScript
JavaScript can do a lot of things, but it is not the solution to every problem. Here are some things to keep in mind.
- Do not rely on JavaScript. Globally over 10% of users disable it. Especially for form validation or other instances where data is at stake, always have a server-side equivalent.
- There are differences in the JavaScript implementations of the dozens of browsers out there. Test your scripts on every browser/platform combination you possibly can!
- Several words are reserved by JavaScript (do not use these as function or variable names):
Reserved Words |
abstract
boolean
break
byte
case
catch
char
class
const
continue
debugger
default
delete
do
double
else
enum
export
extends
false
|
final
finally
float
for
function
goto
if
implements
import
in
instanceof
int
interface
long
native
new
null
package
private
protected
|
public
return
short
static
super
switch
synchronized
this
throw
throws
transient
true
try
typeof
var
void
volatile
while
with
|
|
|