JS

var a = ""
function aa() {
  a="卡卡"
}
aa()    // 注意,aa() 一定要执行,局部赋值全局变量才会有作用
alert(a)

原文地址:https://www.cnblogs.com/500m/p/11247391.html