Hi, I have an ajax request and the on complete event, with the value returned by te request (Ajax.lastData) I want a condition, if its lower than 3 do one thing, greater another thing. Thank you!
Develop games in your browser. Powerful, performant & highly capable.
Event 4, instead of gamesPlayed put Ajax.LastData there.
If you get a NaN error, encapsulate the Ajax.LastData with int() i.e. int(Ajax.LastData)
oh that wasnt the right image, I actually have set the variable gamesPlayed to int(score.LastData) but it doesnt work. And for the image test, the text input remains empty.
Did you rename the ajax object to "score" ??
if not, rename int(score.LastData) to int(Ajax.LastData)
Just noticed you did.
Check your console for the ajax request response and see if you actually get a value from your request
Yes, I can see the response on the console, but the Ajax on completed event its never fired.
Did you try it without the extra conditions ?
Your response appears to be zero, but the second condition requires it to be higher or equal to 3.