Using this to get a value and set it as a var.
var interval;
// Get interval from DB constants table
$.getJSON("/get_slideshow_interval",
function(data){
interval = data;
}
);
console.log(interval);
If I put that console log in the function(data) then it works, but when its out of the getJSON call it returns undefined...
How can I use it outside?