PDA

View Full Version : Just started using javascript


JHobbs
09-20-2002, 11:53 PM
Hi,
I've just started using javascript and I have two very basic questions:

1/ How can I call another function from within a function?
ie
function whatever(param1)
{ "javascript:anotherFunction('param1')";}

2/ How can I call an html link from within a function?
ie
function whatever(param1)
{<a href=" + param1 +">}

thank you in advance for any direction

umm
09-21-2002, 12:18 AM
one way...

<html>
<head>
<title>Example</title>
<script language="javascript" type="text/javascript">
<!-- ;
function secondFunction(page){
alert("Second Function");
location.href=page;
}
function firstFunction(page) {
secondFunction(page);
}
// -->
</script>
</head>
<body onload="firstFunction('http://www.codingforums.com/')">
</body>
</html>

JHobbs
09-21-2002, 02:46 AM
thank you - worked great