javascript - json.stringify 在 javascript 中返回空数组
问题描述
我有一个我创建的对象,如下所示,
var test=[];
test.car=1
test.bike=2
test.cycle=3
结果:[汽车:1,自行车:2,自行车:3]
我有一个期待的控制器
public ActionResult insertTransport(transportModal test)
当我写出data:JSON.stringify(test)
的值data:JSON.stringify(test)
就像[]
我需要做的那样来对对象测试进行字符串化时?
解决方案
推荐阅读
- f# - Excel-DNA,触发 Ribbon 的 onAction 代码时出现问题。F#
- python - 使用 to_gbq 编写日语(utf-8)的大查询
- javascript - 复选框组的 jQuery 验证
- angular - Angular 7 嵌套延迟加载子路由
- php - 用于 Laravel 应用程序的 phpmyadmin 中手动输入的“密码”字段的数据类型?
- python - 如何使用 pywin32 在不重复工作的情况下获取窗口矩形和设备上下文?
- html - 如何在html表格中设置标题
- python-3.x - 如何定义这个 python 函数?
- vue.js - 将编译好的vue-cli项目集成到JSP、tomcat中
- c++ - 如何在 Linux 上将 gtkmm 与 g++ 链接