|
-
Nov 20th, 2002, 05:29 PM
#1
Thread Starter
Fanatic Member
Dynamic Links in JavaScript
I have this JavaScript that creates a heirarchial menu and another that will get the current URL of a page that someone is on. I need to know how to run a javascript function and return a value back to my html. Is this possible? Thanks, Jeremy
He who listens well, speaks well.
-
Nov 20th, 2002, 06:24 PM
#2
Frenzied Member
I'm not really sure what you mean, something like this?
Code:
<script type="text/javascript"><!--
function funcName() {
//Blah blah
return "return value!";
}
//--></script>
<a href="#" onclick="var returnVal = funcName(); alert(returnVal);">Click</a>
If that's not what you meant you'll have to be more specific.
-
Nov 20th, 2002, 06:29 PM
#3
Thread Starter
Fanatic Member
Thanks
I think that will work. Right now I have this to return the URL of the page the client is on:
Code:
function getURL()
{
var CurURL = location.href
alert(CurURL)
}
I need to be able to call that from HTML and have it return a value. So if you way will work, perfect. I have to work on it a bit. Thanks, Jeremy
He who listens well, speaks well.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|