Class SurroundingClass
Private currency = "BTC"
Private url = "https://api.coinbase.com/v2/exchange-rates?currency=" & currency
Private usd = document.querySelector(".usd")
Private twd = document.querySelector(".twd")
Private Function makeRequest() As [function]
xhr = New XMLHttpRequest()
xhr.onload = [function]()
If True Then
Dim response = JSON.parse(Me.responseText)
usd.innerHTML = response.data.rates.USD & " USD"
twd.innerHTML = response.data.rates.TWD & " TWD"
End If
xhr.open("GET", url, True)
xhr.setRequestHeader("CB-VERSION", "2018-01-01")
xhr.send()
End Function
Private Sub New()
End Sub
End Class