Bonjour,
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 : Sélectionner tout - Visualiser dans une fenêtre à part
$('#new_struc').typeahead({source: arrS});
me renvoie une erreur depuis Firebug
ReferenceError: arrS is not defined
Pourtant var arrS existe bien. Pourquoi l'erreur ?

Merci d'avance...