After I submit my form I want to retrieve some data from MySQL through an ajax request but I have some problems with my getJSON function.
This works:
$("form[id=bilddatenbank_sortiment_anlegen]").submit(function() {
var array_sortimentsname;
$.getJSON('inc/inc.sortimentsname.php', function(array_sortimentsname) {
console.debug(array_sortimentsname);
});
return false;
});
I need to access array_sortimentsname outside of the getJSON function, how would I do this?
text/json? Also make a new variable likevar parsedJson = null;and in the function to get the json you can do someting likeparsedJson = array_sortimentsname;and then you can access it outside the function.