0
I have a problem in my application in which I have not the least idea how to solve, let alone the reason for the problem
It turns out that an index is not specifically returning in my request within the jquery function
$.ajax({
url: "http://",
type: 'POST',
data: {texto: text},
success: function(data){
console.log(data);
}
});
So far everything is perfect!
But look what returns in the console.log
Within the function it returns only the array items, and not the sugestions as well,
It would be right to return this
I don’t even know how to research this.
In php there is nothing else, just the results, and then a json_encode()
$return->suggestions= $suggestions->suggestions;
$return->items = $this->getImagem($produtos);
return json_encode($return);
What you have in PHP?
– Sergio
just a json From what I showed above, I’ll put it in the post
– SOSTheBlack
has already tried to change the
$return->items
to another name to see if it is not a jQuery helper who does it ? for example$return->produtos
– Luan Castro
I will make the change here, but just remembering that the item that is not returning is "suggestions" and not "items
– SOSTheBlack
Try this: var_dump($Return); die(); and see what returns.
– Ivan Ferrer