Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple onload functions?

Status
Not open for further replies.

generlam

Programmer
Jun 13, 2001
75
0
0
US
Can you have more than one onload function, e.g.,
<body onload="preloadImages();setVisibility('glctr','hidden');">
 
Yes.

You can also have a function that calls other functions, which is the approach I'd take for the sake of maintainability.

Code:
function myFunc1()
{
  return true;
}

function myFunc2()
{
  return true;
}

function myOnloadFunc()
{

  var x = myFunc1();
  var y = myFunc2();

  if (x && y)
  { return true;
  } else
  { return false;
  }

Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top