Calling more than one JavaScript function in a body tag (or other) event handler

Calling more than one JavaScript function in a body tag (or other) event handler

We may call more than one javascript function by seperating semi-colon as follows.

Example:

<body onload=”callFunction1();callFunction2();”>

In a mouseover, we can call as follows,

onMouseOver=”callFunction1();callFunction2();”>

In JavaScript, the semi-colon is essentially an end-of-line marker. Within reasonable limits, we can actually write a whole script inside of an event handler.

The same thing applies to the href=”javascript:etc” mce_href=”javascript:etc” structure. For instance:

<a href=”javascript:callFunction1();callFunction2();” mce_href=”javascript:callFunction1();callFunction2();”>
Click Here
</a>

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.