Why is onBeforeAjax invoked several times for one request?

edited August 2015 in Technical questions

I have following code

webix.attachEvent("onBeforeAjax", function(mode, url, data, request, headers) {
    console.log("url: " + url);

When arise any request i see several lines in my logs, but browser shows only one request. Why so?


  • Not sure. Normally it must one onBeforeAjax call for one request.

    It possible that code aborts XHR requests ( for example if you are calling some.load(url); some.clearAll();, such code will start request, call onBeforeAjax and abort the request. As result there will be onBeforeAjax call, but there will not be a real request.

  • How can i write some code which will be invoked only once for one real request?

  • May be it will useful for someone, I've found solution as redefine send message in XMLHttpRequest prototype

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!