javascript – RESTful Backbone应用程序中JSON的预期结构是什么?
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了javascript – RESTful Backbone应用程序中JSON的预期结构是什么?,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2670字,纯文字阅读大概需要4分钟。
内容图文
使用Backbone / Marionette开发专有的CRM应用程序,我想知道,Backbone对JSON的期望是什么结构?这就是我目前正在使用的内容,但我可以将其更改为最适合的内容. (如果可能的话,我想避免设置自定义解析功能.)
{
"rowCount":"1",
"records":[
{
"objectName":"",
"User_UserID":"",
"User_EmailAddress":"",
"User_Password":"",
"User_EncPassword":"",
"User_Premium":"",
"User_FirstName":"",
"User_LastName":"",
"User_Honorific":"",
"User_Title":"",
"User_Nickname":"",
"User_ParentCompany":"",
"User_Company":"",
"User_Publication":"",
"User_Website":"",
"User_ShipAddress1":"",
"User_ShipAddress2":"",
"User_ShipAddress3":"",
"User_ShipCity":"",
"User_ShipState":"",
"User_ShipCountry":"",
"User_ShipZip":"",
"User_BillCompany":"",
"User_BillFirstName":"",
"User_BillLastName":"",
"User_BillAddress1":"",
"User_BillAddress2":"",
"User_BillAddress3":"",
"User_BillCity":"",
"User_BillState":"",
"User_BillCountry":"",
"User_BillZip":"",
"User_PhoneNo":"",
"User_FaxNo":"",
"User_HomeNo":"",
"User_MobileNo":"",
"User_OtherNo1":"",
"User_OtherNo2":"",
"User_IChat_Aim":"",
"User_IChat_Gchat":"",
"User_IChat_MSN":"",
"User_IChat_Etc":"",
"User_CreateIPAddress":"",
"User_CreateDate":"",
"User_ViewDate":"",
"User_ModifyDate":"",
"User_ConvertDate":"",
"User_LastMailedDate":"",
"User_LastACSCheckDate":"",
"User_CCType":"",
"User_CCNo":"",
"User_LoggendBy":"",
"User_ContactVia":"",
"User_Source":"",
"User_RelatedAssistant":"",
"User_Specialties":"",
"User_JobType":"",
"User_CompanyType":"",
"User_TaxID":"",
"User_Notes":"",
"User_TermsExtended":"",
"User_AcsAdvice":"",
"User_MailList":"",
"User_EMailList":"",
"User_PressList":"",
"User_CustomList":"",
"User_HolidayList":"",
"User_VIPList":"",
"User_MarketingBlacklist":"",
"User_SalesBlacklist":"",
"User_IsCustomer":"",
"User_Answer1":"",
"User_Answer2":"",
"User_Answer3":"",
"User_Answer4":"",
"User_Answer5":"",
"User_NewPassword":"",
"User_OldPassword":"",
"User_FMUserID":"",
"User_FMUser":"",
"User_BetaUser":"",
"User_ShowFeatures":"",
"User_TermsVersion":"",
"User_TOSVersion":"",
"User_TOSDate":"",
"User_TOSIP":"",
"User_TOSLastVersion":"",
"User_TOSLastDate":"",
"User_TOSLastIP":"",
"User_LoginDate":"",
"User_LoginIPAddress":"",
"User_FMName":"",
"User_NameSuffix":"",
"User_FaxLabel":"",
"User_OtherNo1Label":"",
"User_OtherNo2Label":"",
"User_EmailAddressAlternate":"",
"User_LoggedBy":"",
"User_IsObsolete":"",
"User_AddressSame":"",
"User_UserDate":"",
"User_DeferredPay":"",
"User_TaxExempt":"",
"User_TaxExemptID":"",
"User_Saved":"",
"User_Status":"",
"User_Migrated":""
}
]
}
解决方法:
本地,Backbone.Model需要一个简单的字符串字典:
{
"name": "Bob",
"address": "12345 Simple St",
...
}
…和Backbone.Collection期望一组简单的字符串字典:
[{
"name": "Bob",
"address": "12345 Simple St",
...
},{
"name": "Al",
"address": "12347 Main St",
...
},
...
]
内容总结
以上是互联网集市为您收集整理的javascript – RESTful Backbone应用程序中JSON的预期结构是什么?全部内容,希望文章能够帮你解决javascript – RESTful Backbone应用程序中JSON的预期结构是什么?所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。