Home >Web Front-end >JS Tutorial >Sharing a simple example of generating json data with javascript_javascript skills

Sharing a simple example of generating json data with javascript_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:00:07963browse
Copy code The code is as follows:

//Define the object
var finalInfo = new Object();
//Assign a value to the object
finalInfo.purchaseInfoId = '';
finalInfo.purchaseMethodType = '';
finalInfo.contact = '';
finalInfo.contactTel = '';
finalInfo.bidInfoStr = '';
//Convert the object to json format
var finalInfoStr = JSON.stringify(finalInfo);
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