Home  >  Article  >  Backend Development  >  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
WBOYOriginal
2016-12-01 00:25:211084browse

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()

Statement:
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