l(x)
is my shortcut to console.log(x)
. item.php
has text "EYES!!", just that.
var session = $.get("item.php", function(data) { session = data; })
l(session);
// *all XHR flags in an object, responseText ("EYES!!"), status (200) etc.
$.get("item.php", function(data) { session = data; })
l(session);
// undefined
$.get("item.php", function(data) { l(data) })
// "EYES!!"
(note, these are 3 different cases, but I cannot them get seperated without HTML freaking out)
Is there a way for me to transfer $.get
response into external variable? Code generally looks something like this:
var session;
(need some fairy magic to happen)
l(session);
// "EYES!!"