File tree 1 file changed +7
-3
lines changed
example/src/main/scala/example
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -123,10 +123,13 @@ object XMLHttpRequest{
123
123
@ JSExport
124
124
def main (pre : html.Pre ) = {
125
125
val xhr = new dom.XMLHttpRequest ()
126
- xhr.open(" GET" , " https://www.boredapi.com/api/activity" )
126
+ xhr.open(" GET" ,
127
+ " https://www.boredapi.com/api/activity"
128
+ )
127
129
xhr.onload = { (e : dom.Event ) =>
128
130
if (xhr.status == 200 ) {
129
- pre.textContent = xhr.responseText
131
+ pre.textContent =
132
+ xhr.responseText
130
133
}
131
134
}
132
135
xhr.send()
@@ -162,7 +165,8 @@ object AjaxExtension {
162
165
.ExecutionContext
163
166
.Implicits
164
167
.global
165
- val url = " https://www.boredapi.com/api/activity"
168
+ val url =
169
+ " https://www.boredapi.com/api/activity"
166
170
Ajax .get(url).foreach { case xhr =>
167
171
pre.textContent = xhr.responseText
168
172
}
You can’t perform that action at this time.
0 commit comments