Created
February 1, 2020 10:01
-
-
Save mulya/8bbce460702624d090b000ccde12577d to your computer and use it in GitHub Desktop.
ScalaJS JQuery facade ajax usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax(js.Dynamic.literal( | |
url = "https:/url.net/1234567", | |
method = "GET", | |
cache = false, | |
success = (arg1: js.Dynamic, arg2: String, arg3: JQueryXHR) => { | |
println(js.JSON.stringify(arg1)) | |
val p = document.createElement("p") | |
val text = document.createTextNode(arg1.track.id.toString) | |
p.appendChild(text) | |
document.body.appendChild(p) | |
}, | |
error = (jqXHR: JQueryXHR, textStatus: String, errorThrow: String) => { | |
println(s"jqXHR=$jqXHR,text=$textStatus,err=$errorThrow") | |
} | |
).asInstanceOf[JQueryAjaxSettings]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment