PHP生成数组再传给js的方法
内容摘要
<script type="text/javascript">
var slist = '<?php echo urlencode(json_encode($data['arr']));?>';
var list = eval(decodeURIComponent(slist));
dr
var slist = '<?php echo urlencode(json_encode($data['arr']));?>';
var list = eval(decodeURIComponent(slist));
dr
文章正文
<script type="text/javascript"> var slist = '<?php echo urlencode(json_encode($data['arr']));?>'; var list = eval(decodeURIComponent(slist)); drawGpsMap(list); </script>
代码注释