I have a situation that looks like this:
elFinder.prototype.commands.info = function()
{
this.exec = function(hashes)
{
var temp_array = new Array(),
temp_html = new String();
var request = new XMLHttpRequest();
request.onload = function()
{
temp_html = "<a href='foo'>bar</a>";
temp_array.push(temp_html);
alert("Inner - Array size is " + temp_array.length);
}
request.open("get", "example.com/url", true);
request.send();
alert("Inner - Array size is " + temp_array.length);
}
}
This results in the following outputs, respectively:
Inside - Array size is 1
and
Outside - Array size is 0
It appears that the array content is being somehow lost.