Я начинающий в программировании, и я застрял на данный момент.
Давайте посмотрим мой код:
$.ajax({
url: "http://example.com/mydataset.json?example1="+variable1,
type: "GET",
data: {
"$limit" : 5000
}
}).done(function(data) {
console.log(data.options);
variable2 = data.options;
});
return variable2; /////////// Until here it's working perfect
});
$.ajax({
"http://example.com/mydataset2.json?example2="+variable2,
// The error is in this link, the variable is undefined.
type: "GET",
data: {
"$limit" : 5000
}
}).done(function(data) {
console.log(data);
});
Что не так с моим кодом, кто-то может объяснить это?