我正在 windows phone 7 上测试一个移动网站,但 JSON.stringify 函数不起作用。有谁知道为什么会发生这种情况或我能做些什么来解决这个问题?我正在对数组进行字符串化,以便将其存储在 cookie 中。这是我的代码:
vString = JSON.stringify(vehicleArray);
alert ('this alert will never execute');
$j.cookie('vehicleCookie', vString, { expires: 7, path: '/' }); //Store all the vehicles again to the cookie
vString 行之外的任何代码都将停止执行。
如果记录的话, vehicleArray 看起来像这样:
["145", "273", "241", "553", "490", "380"]
我无法提供有关什么工作或不工作的太多信息,因为 Windows Phone 没有我知道的任何类型的调试器,并且代码在 ie7 中工作正常。