Home > Backend Development > PHP Tutorial > javascript - God help! Regarding the issue of which type is json in $.get()

javascript - God help! Regarding the issue of which type is json in $.get()

WBOY
Release: 2023-03-01 15:22:02
Original
1142 people have browsed it

javascript - God help! Regarding the issue of which type is json in $.get()

javascript - God help! Regarding the issue of which type is json in $.get()
Why can’t my console.log() print it out? If I remove the json in $.get(), I can print it out.

Reply content:

javascript - God help! Regarding the issue of which type is json in $.get()

javascript - God help! Regarding the issue of which type is json in $.get()
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! javascript - God help! Regarding the issue of which type is json in $.get()

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template