I have the following ajax request
<script>
$(document).ready(function(){
$.ajax({
url:'obtenerusuarios',
dataType:'json',
type:'get',
cache:true,
success:json
});
function json(data){
console.log(data);
}
});
</script>
This Ajax request return the list of users and I want to change the results of this response into javascript variable. I need to replace the availableTags
array with the new data in response
<script>
$(function() {
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$( "#tags" ).autocomplete({
source: availableTags
});
});
</script>