I have script following:
var price_option_oc = 0;
// Example
jQuery.ajax({
type: "POST",
processData: false,
dataType: "text",
url: mainURL + url_ajax_get_prices_oc,
data: JSON.stringify(datas),
contentType: "application/json; charset=utf-8",
}).done(function(data) {
console.log('{1}=' + data);
price_option_oc = data;
});
console.log('{2}' + price_option_oc);
Why result is, I dont know why, please explain for me
{2}0
{2}0
{1}=9
{1}=9
Why not is:
{1}=9
{1}=9
{2}0
{2}0
Thanks.