简体   繁体   中英

Script add another script

I'm new to javascript and I have this issue. I have an array which I need to append inside my script tag, which means:

Example:-

array(abc=>'abc', def=>'def')

var markers = [
// putting the array here
]

In PHP I can just echo, but how can I achieve it in javascript? Furthermore, each time I click the button, it will call this function. Will it duplicate the variable markers each time I click?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM