As my framework grows i decided to split it into files, instead of leaving it in the main design file. However by doing that the return of a function doesn't return any value.
data isn't empty - if i alert the values in the js file they are there!
The functions:
1st the function in .js file (is included before the execution)
var lock_get = 0;
function get_data(data, destination)
{
if (lock_get == 0)
{
lock_get = 1;
$.ajax({
type: "POST",
url: destination,
async: true,
data: data,
success: function(data)
{
lock_get = 0;
if (data)
{
return data;
}
}
});
}
};
So and here is the execution part:
var test = get_data(data, destination);
notice(test);
and test is empty... I already tried different ways for writing but I guess i missunderstood the possibilities of js?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…