using scala.js method as callback
问题 I am loading google map in async way , @JSExport("sample") object Sample { def loadScript = { val script = document.createElement("script").asInstanceOf[HTMLScriptElement] script.`type` = "text/javascript" //case 1 script.src = "https://maps.googleapis.com/maps/api/js?v=3.exp&callback=sample().initialize" // case 2 script.src = "https://maps.googleapis.com/maps/api/js?v=3.exp&callback=sample.initialize" document.body.appendChild(script) } @JSExport def initialize() :Unit = { println(" map