Hi, we are developing a web application using GWT in the front end.
In GWT we make calls to the server by appending javascript code as stated below:
public native static void call(int requestId, String url, ICall handler) /*-{
var callback = "callback" + requestId;
//Create a script element.
var script = document.createElement("script");
script.setAttribute("src", url+callback);
script.setAttribute("type", "text/javascript");
script.setAttribute("async", "true");
//Define the callback function on the window object.
window[callback] = function(response) {
[email protected]::handleResponse(Ljava/lang/String;)(response);
}
//Attach the script element to the document body.
document.body.appendChild(script);
}-*/;
Some calls take a minute to complete and some others just a couple of seconds. If we make multiple calls at the same time all of them are executed in parallel . This means that a call that ends in 2 seconds does not have to wait until a call that lasts a minute finish. This is true in Chrome and Safari. However Firefox waits until the first invoked function finishes to start the other functions.
Why does Firefox waits until a javascript function is finished to start another function? How to fix this?
Thanks