Javascript has some strict rules and referring to vairables. Your function name and variable name must begin with a letter and they can contain only letters, number and underscores. By conversion function and variables names must begin with lower letters, but they use uppercase for additional words. For example autotext() is completly different from autoText() in the javascript. Javascript is case sensitive.
Reserved Keywords:
abstract , boolean , byte , case , catch , char , class , const , debugger , default
delete , do , double , else , enum , export , extends , false , final , finally , float , for , function , goto , if , imports , in , int , interface , null , new , package
public , protected , return , this , throw , throws , typeof , true , try , void
Triggering scripts with events
autoText The scripts loads when a page is loaded. Like this we can call scripts when the user clicks the button or mouse overs on a image. Each of these clicks are called as events.
Some events are used by the document's BODY as a whole, and some are used by specific tags such as images , anchor tags , buttons.
Events that are assigned to the BODY Tag
1. onLoad when the document loads.
2. onUnload When a new document is loaded.
3. onFocus When the browser window recieves focus.
4. onBlur When the browser window loses focus.
5. onHelp when the user presses F1(IE only).
6. onKeypress when the user presses a key. Except the function keys.
Events that are used to tags includes
1.onFocus When the tag receives focus.
2.onBlur When the tag loses the focus.
3. onMouseOver When the user moves the mouse over the tag.
4. onMouseOut When the use moves the mouse away from the tag.
5. onChange When a form element value is changed.
6. onClick When a tag is clicked.
7. onSubmit When a form is submitted.
we can use these events to run our scripts based on different user actions
No comments:
Post a Comment