Why can’t my console.log() print it out? If I remove the json in $.get(), I can print it out.
Why can’t my console.log() print it out? If I remove the json in $.get(), I can print it out.
The json parameter is what data type you want the server to return. You specified it as json. The server returns an object string (not json format) format, so it cannot be parsed?
You can directly print the data type to see.
Remove var_dump($result)
What parameter does your "json" count as in $.get(url,data,callback) in api?
echo json_encode($arr); is correct
Solved. The code was written correctly, but I was too careless and opened it locally. I need to open it in the screenshot, I didn’t notice it for a moment, thank you!