Hi guys! Why the function "myfunc" or "this.ready" is not called by "this.req.onreadystatechange := myfunc" when the response is done? If "ready" is outside of the class then will work! Any solution for my issue?
CODE:
#Requires AutoHotkey v2.0
CoordMode "Mouse", "Screen"
class requests {
__New() {
this.req := ComObject("Msxml2.XMLHTTP")
}
get(url) {
this.req.open("GET", url, true)
this.req.send()
myfunc := this.ready
this.req.onreadystatechange := myfunc
}
ready() {
MsgBox("response is done")
}
}
requests().get("https://pokeapi.co/api/v2/pokemon/1")
Statistics: Posted by ositoMalvado — Today, 15:47