Results 1 to 3 of 3

Thread: Dynamic Links in JavaScript

  1. #1

    Thread Starter
    Fanatic Member JCScoobyRS's Avatar
    Join Date
    Oct 2002
    Location
    Some Mountain in Colorado
    Posts
    677

    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.

  2. #2
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    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.

  3. #3

    Thread Starter
    Fanatic Member JCScoobyRS's Avatar
    Join Date
    Oct 2002
    Location
    Some Mountain in Colorado
    Posts
    677

    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
  •  



Click Here to Expand Forum to Full Width