Attach multiple functions to events
Attach multiple functions to events
The function that need to place some wear on page:
function addEvent(obj, evType, fn)
{
{
if (obj.addEventListener)
{
else if (obj.attachEvent)
{
else
{
}{
obj.addEventListener(evType, fn, false);
return true;
}return true;
else if (obj.attachEvent)
{
var r = obj.attachEvent("on"+evType, fn);
return r;
}return r;
else
{
return false;
}Sample to call the function:
addEvent(window, 'load', functionName);
No comments:
Post a Comment