var dataOpt = {
@foreach($options as $option)
@if($option->option_type == 0)
Select_{{ $option->id}},
@endif
@if($option->option_type == 1)
ImageRadio,
@endif
@endforeach
product_id : {{$product->id}
};
注意:此代码在Chrome中有效,但在IE 11中返回错误:
SCRIPT1003: Expected ':' on line 5.
非常感谢您的帮助。有人有主意吗?
答案 0 :(得分:0)
您的输出无效json。您的属性没有值,其名称应用双引号引起来。您可以尝试以下操作:
{
"options": ["Select_3", "Select_4", "Select_13"],
"product_id": 10
}