How do I request a variable from the webserver using AJAX?
问题 I have a loop in my JavaScript that is constantly checking the variable EventCounter , if eventcounter is zero then it proceeds to do an action then increment it ++, And then it proceeds to do nothing, until that variable changes, here is the code: EventCounter = {{eg.globals.EventCounter}}; for(var i = 0; i < n; ++i) { r = rects[i]; ctx.strokeRect((r.x*sc)|0,(r.y*sc)|0,(r.width*sc)|0,(r.height*sc)|0); window.rects = rects[i]; //console.log(EventCounter); if (EventCounter === 0) { console.log