Home >Web Front-end >JS Tutorial >Print the content of the json object and JSON.stringify function application_json

Print the content of the json object and JSON.stringify function application_json

WBOY
WBOYOriginal
2016-05-16 17:38:561259browse

When debugging, you often need to know the content of the json object. Through the JSON.stringify function, you can convert the json object into a string.

Copy code The code is as follows:

$(document).ready(function() {
$.ajax({
type: "post",
dataType: "json",
url: '/centermanage/modules/admin/index.php?task=getequipmentinfo',
data: "&id=" id,
error: function(msg){
 alert(JSON.stringify(msg)); <br>}, <br>success : function(msg) { <br>alert(JSON.stringify(msg)); <br>}) <br>})


 




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