空白の Meteor プロジェクトを作成し、ハンドルバーの HTML ファイルに <SELECT> タグを挿入しようとしました。これは Chrome、Firefox、および Safari で機能しますが、IE8 は selected="selected" 属性を無視します。
<head><title>test</title>
</head>
<body>
<select>
<option>abc</option>
<option selected="selected">def</option>
<option>ghi</option>
</select>
</body>
したがって、IE8 は選択されたオプションとして「abc」を表示します。
また、Handlebar ヘルパー関数を作成しようとしましたが、同じ結果が得られました。
<head><title>test</title>
</head>
<body>
{{{hbarselect}}}
</body>
// in the js file
Handlebars.registerHelper("hbarselect", function(value) {
var ret = '';
ret = '<select>';
ret += '<option>abc</option>';
ret += '<option selected="selected">def</option>';
ret += '<option>ghi</option>';
ret += '</select>';
return new Handlebars.SafeString(ret);;
});
Handlebars を完全に無視して単純な HTML ファイルを作成すると、IE8 は適切に動作します。
<html>
<head>
</head>
<body>
<select>
<option>abc</option>
<option selected="selected">def</option>
<option>ghi</option>
</select>
</body>
</html>
これを機能させるためにハンドルバーについて知っておくべきことはありますか? どうすればこれを修正できますか?