dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: saving a parameter

  1. #1
    Join Date
    Mar 2003
    Location
    Yardley, PA
    Posts
    60

    saving a parameter

    I am returing a parameter to a function during a mouse over. the function works fine but I want to save the parameter value as a variable.

    How do I do it?

  2. #2
    Can you post the function you are using? It would help to see it.

  3. #3
    Join Date
    Dec 2002
    Location
    WI, United States
    Posts
    1,372
    I think what you want is a global variable, right? If so, then you must declare it outside of the function. Like this:

    var saveme;
    function mouse_over(TheVar){
    saveme=TheVar;
    }

    I think that will do what you wanted.

  4. #4
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    I'm assuming you're doing it something like this...

    function mover(var)
    {
    //code
    }


    ------

    onmouseover="mover('somevalue');

    Is that correct?

    if so, in your function just go...

    function mover(var)
    {
    somenewvar = var;
    //code
    }


    This will throw the value of var into the somenewvar variable.

  5. #5
    Join Date
    Mar 2003
    Location
    Yardley, PA
    Posts
    60

    thanks

    that was the fiirst thing I tried, but I am getting a little too fancy for my own good. Tried following on the debugger instead of placing a simple alert() to track it. And then didn't set the break point right.

    Thansk for the help

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles