Julius Caesar's great-great-granddaughter (zyada) wrote in javascript,
Julius Caesar's great-great-granddaughter

Help with variable scope?

I have a variable that I want to retain its value between function calls. The page is here: http://zyada-stuff.com/SpreadingRoots/temp.html

The function is an event listener, and the variable is map_marker0. If I could get the variable to retain its value between calls, line #45 would erase the marker so that it could be reset to a new spot. Right now, the page just creates a new marker.
  • Post a new comment


    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.