![](/img/trans.png)
[英]I get the error SCRIPT1003: Expected ':' in IE 11; (Java Script Code error)
[英]How can i solve this error in IE ? SCRIPT1003: Expected ':'
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.
我真的很感激任何幫助。 有人有想法嗎?
您的輸出不是有效的 json。 您的屬性沒有值,它們的名稱應該用雙引號括起來。 您可以嘗試以下操作:
{
"options": ["Select_3", "Select_4", "Select_13"],
"product_id": 10
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.