|
Q1076 Function does not execute (2)
irt.org | Knowledge Base | JavaScript | NotABug | Q1076 [ previous next ]
Q1076 Function does not execute (2)
Symptom: The function called does not do anything.
Affects: All browsers
Reason: Function name is a reserved name:
Do not use any of the following names as function or variable names
| Reserved Javascript Keywords |
| break |
do |
if |
return |
var |
| case |
else |
import |
switch |
void |
| continue |
export |
in |
this |
while |
| default |
for |
new |
typeof |
with |
| delete |
function |
|
|
|
| Words Reserved for ECMA Extensions |
| catch |
const |
enum |
finally |
throw |
| class |
debugger |
extends |
super |
try |
| Java Keywords Reserved by JavaScript |
| abstract |
final |
int |
package |
static |
| boolean |
float |
interface |
private |
synchronized |
| byte |
goto |
long |
protected |
throws |
| char |
implements |
native |
public |
transient |
| double |
instanceof |
null |
short |
true |
| false |
|
|
|
|
| Other Identifiers to Avoid |
| alert |
escape |
Math |
parseFloat |
setTimeout |
| arguments |
eval |
menubar |
parseInt |
status |
| Array |
find |
moveBy |
personalbar |
statusbar |
| blur |
focus |
moveTo |
print |
stop |
| Boolean |
frames |
name |
prompt |
String |
| callee |
Function |
NaN |
prototype |
toolbar |
| caller |
history |
netscape |
RegExp |
top |
| captureEvents |
home |
Number |
releaseEvents |
toString |
| clearInterval |
Infinity |
Object |
resizeBy |
unescape |
| clearTimeout |
innerHeight |
open |
resizeTo |
unwatch |
| close |
innerWidth |
opener |
routeEvent |
valueOf |
| closed |
inFinite |
outerHeight |
scroll |
watch |
| confirm |
isNaN |
outerWidth |
scrollbars |
window |
| constructor |
java |
Packages |
scrollBy |
navigator |
| Date |
length |
pageXOffset |
scrollTo |
click |
| defaultStatus |
location |
pageYOffset |
self |
logon |
| document |
locationbar |
parent |
setInterval |
|
| Reserved Internet Explorer 5 JavaScript Keywords |
| start |
|
|
|
|
[Major part of this list comes from JavaScript, The Definitive Guide 3rd edition]
Workaround: Change the name
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.