Not clear about your intent. Complain about the following, and that may give me better understanding. Note test() will ALWAYS report "calling function1" - there is no function1.
<html>
<head>
<script type="text/javascript"">
function test() {
var msg;
try {
msg = "calling function1";
function1();
msg = "function1 passed - calling function2";
function2();
msg = "function2 passed - calling function3";
function3()
msg = "all functions passed";
}
catch (e) {
;// do something useful here
}
return msg;
};
function functiona() {;};
function functionb() {;};
function functionc() {;};
function test2() {
try {
functiona();
functionb();
functionc();
alert("all functions passed");
}
catch (e) {
;// do something useful here
}
};
window.onload = function() {
alert(test());
test2();
};
</script>
</head>
<body>
<div>some content here</div>
</body>
</html>