Hi, I have a script that is running every 5 seconds, as a polling ajax http request.
I want to send an incrementing amount through it, on each request (1,2,3,4,5,6 etc...)
I have this so far, but the code just sends '1' through all the time.
// set the value to 1
var state = {
recordId: 1
};
$.ajaxPoll({
url: "map-service.cfc?method=getpoints",
type: "POST",
data: state,
dataType: "json",
successCondition: function(location) {
// return result != null; // custom condition goes here.
// increment it by 1
state.recordId = state.recordId +1
alert(state.recordId)
}
Does anyone know how to submit an increasing value through the 'data' param in the POST?