Hi,
I have the following handler at /handlers/ajax.cfc:
component {
function jurisdictions(event, rc, prc) {
event.renderData(type=“text”, data=“Correct output”);
}
}
I can make a request to that handler with this JQuery, and expect to get back the string “Correct output”:
$.ajax("/ajax/jurisdictions", {
dataType: “text”,
cache: false,
success: function(data) {
$("#results").append(“
},
});
The problem I’ve encountered is that this works as expected, except when multiple requests are made in quick succession. If I wrap that jquery ajax call in a for loop that runs the ajax call more than once, or if I set the ajax call to fire via mouse click and rapidly click the button, then some of the responses I get to the ajax requests return “Correct output” as expected, but some of the ajax requests return the contents of running my defaultEvent, which in this case is my home page.
How is it that if I issue multiple quick requests to the /ajax/jurisdictions URL, ColdBox sometimes routes to the correct resource, and sometimes runs the default event? Is this a config issue on my end, or a ColdBox bug?
Thanks,
Conan