JavaScript is often used together with Java. You should avoid using some Java objects and properties as JavaScript identifiers:
| getClass | java | JavaArray | javaClass |
| JavaObject | JavaPackage |
Other Reserved Words
JavaScript can be used as the programming language in many applications.
You should also avoid using the name of HTML and Window objects and properties:| alert | all | anchor | anchors |
| area | assign | blur | button |
| checkbox | clearInterval | clearTimeout | clientInformation |
| close | closed | confirm | constructor |
| crypto | decodeURI | decodeURIComponent | defaultStatus |
| document | element | elements | embed |
| embeds | encodeURI | encodeURIComponent | escape |
| event | fileUpload | focus | form |
| forms | frame | innerHeight | innerWidth |
| layer | layers | link | location |
| mimeTypes | navigate | navigator | frames |
| frameRate | hidden | history | image |
| images | offscreenBuffering | open | opener |
| option | outerHeight | outerWidth | packages |
| pageXOffset | pageYOffset | parent | parseFloat |
| parseInt | password | pkcs11 | plugin |
| prompt | propertyIsEnum | radio | reset |
| screenX | screenY | scroll | secure |
| select | self | setInterval | setTimeout |
| status | submit | taint | text |
| textarea | top | unescape | untaint |
| window |
HTML Event Handlers
In addition you should avoid using the name of all HTML event handlers.
Examples:| onblur | onclick | onerror | onfocus |
| onkeydown | onkeypress | onkeyup | onmouseover |
| onload | onmouseup | onmousedown | onsubmit |
Practice Excercise Practice now