ReferenceError: arrS is not defined
Bonjour,
Code:
1 2 3 4 5 6 7
| $.ajax({
success: function(data){
var arrS = $.map(data.init.strucs, function(elm, index) { return elm['name'] }), arrP = $.map(data.init.posts, function(elm, index) { return elm['name'] }), arrR = $.map(data.init.rangs, function(elm, index) { return elm['name'] });
alert(arrS.length + ' - ' + arrP.length + ' - ' + arrR.length);
}
});
$('#new_struc').typeahead({source: arrS}); |
alert() dans $.ajax() marche, par contre
Code:
$('#new_struc').typeahead({source: arrS});
me renvoie une erreur depuis Firebug
Citation:
ReferenceError: arrS is not defined
Pourtant var arrS existe bien. Pourquoi l'erreur ?
Merci d'avance...