Scala js jQuery GET请求结果

时间:2016-12-21 14:58:11

标签: ajax scala scala.js

我是JS,Ajax等和Scala JS的新手。我有一个小的REST API,我可以发送GET请求(例如localhost:9000 / stats?first = abc& second = cde& from = 1482327698& to = 1482327998)

我如何在Scala JS中执行此操作?我试过这个:

  val successButton = Button(ButtonStyle.success)("Plot", onclick.:=(Bootstrap.jsClick(_ => {
  val subj1 = firstText.now
  val subj2 = secondText.now
  val now = System.currentTimeMillis / 1000
  val from = now - 300

  val url = s"http://127.0.0.1:9000/stats?first=$subj1&second=$subj2&from=$from&to=$now"

  jQuery.get(url)
}))).render

但它几乎没有给我什么。提前致谢

0 个答案:

没有答案