Access javascript variable outside of function

后端 未结 1 1265
伪装坚强ぢ
伪装坚强ぢ 2021-01-26 09:22

I have an init() function which creates an image overlay for a map when the html body is loaded. within the function a mapOverlay variable is created. It\'s basically the functi

1条回答
  •  心在旅途
    2021-01-26 09:36

    You need to declare the variable outside of the scope of your function to be able to use it in other functions.

    So:

    
    

    0 讨论(0)
提交回复
热议问题