Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (27 sloc) 638 Bytes
package webpage
import org.scalajs.dom
import org.scalajs.dom.{Node, Element}
import scalajs.js
import scalajs.js.annotation.JSExport
import scalatags.JsDom.all._
import dom.html
@JSExport
object Weather1 extends{
@JSExport
def main(target: html.Div) = {
import dom.ext._
import scala.scalajs
.concurrent
.JSExecutionContext
.Implicits
.runNow
val url =
"http://api.openweathermap.org/" +
"data/2.5/weather?q=Singapore"
Ajax.get(url).onSuccess{ case xhr =>
target.appendChild(
pre(xhr.responseText).render
)
}
}
}