I want to return StudentId to use elsewhere outside of the scope of the $.getJSON()
StudentId
$.getJSON()
j.getJSON(url, data, function(result)
var context; $.ajax({ url: 'file.json', async: false, dataType: 'json', success: function (json) { assignVariable(json); } }); function assignVariable(data) { context = data; } alert(context);