I researched on this question in forums but could not succeed with applying code in answers given by techies. I am trying to access a variable which is inside jquery success function. It throws null as it was assigned null on initialisation. How can I access data value out side ajax call? Also my Stringified result shows "/" slashes in json string. How can I remove slashes in code. I tried applying regex, replacing / with quotes but no use. Please suggest.
var details=null;
        $.ajax({
            type: "GET",
            url: "/Default/GetDetails",
            contentType: 'application/json; charset=utf-8',
            dataType: 'json',
            success: function (data) {
                details = JSON.stringify(data);            
            },
            error: function (xhr, ajaxOptions, thrownError) {
                alert(xhr.statusText);
            }
        });
    alert(details)
 
     
    