i'm having a problem with a variable at my jquery, follow the code:
var resp;
if(itcode != ""){
resp = $.ajax(
{url: url_rq}
);
resp.done(function () { alert(resp.responseText); });
}
If i put the "resp.responseText" like this above it prints the response, but if i try this code:
var resp;
if(itcode != ""){
resp = $.ajax(
{url: url_rq}
);
}
alert(resp.responseText);
It prints "undefined", what's going on with my "resp" variable?