我收到如下回复
var val = {"Type"=>"D","Number"=>33"}
从上面我尝试像这样改变
var MyArray = {"Type": "D", "Number": "33"};
for(key in MyArray)
{
alert("key " + key
+ " has value "
+ MyArray[key]);
}
我尝试替换,替换所有不工作的。有什么建议么?
从评论中粘贴的服务器端代码...
new_transfer_header = @params['my_extra_param']
p new_transfer_header,'------------ ew_transfer_header----------,new_transfer_header.class
WebView.execute_js("replaceDeliveryWithScanUnit('#{new_transfer_header}')")
puts result as "{\"Type\"=>\"D\", \"Number\"=>\"33\"}