Can someone show me ho can i use the variables stored in this Ajax call:
$.get( "nuoviServiziReview.html", function( data ) {
var nuovoServizioReview = $('<div/>',{id:'servizio'+ incremento});
nuovoServizioReview.html(data);
nuovoServizioReview.appendTo(parentDiv2);
servizio = nuovoServizioReview;
reviewOption1 = nuovoServizioReview.find('.select1');
reviewOption2 = nuovoServizioReview.find('.select2');
reviewOption3 = nuovoServizioReview.find('.select3');
prezzoFisso = nuovoServizioReview.find('.select1').children('label:last-child');
nuovoIdCheckbox.attr('checked', true);
$(thisBtnOk).addClass('hidden');
//Add title to Review Section
var newServiceTitle = ($(idInputeText).val());
servizio.text(newServiceTitle);
});
After the call is done, I need to use the variables inside it but from outside the function. I tried to console.log for example the "servizio" var but it print out nothing on the console. I tried to check different examples but I didn't understand how to use them. Can someone show me a practical example? This ajax call is done after a button is clicked on my index page.