【发布时间】:2012-11-20 01:58:18
【问题描述】:
我创建了一个空白 Meteor 项目并尝试在车把 HTML 文件中放置一个
<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>
要完成这项工作,我需要了解有关 Handlebars 的一些信息吗?我该如何解决这个问题?
【问题讨论】:
-
我在 IE9 中也看到了同样的问题,正在调查(IRC 上的#meteor 可能会有所帮助)。这是我目前的代码:gist.github.com/4120133
-
看起来可能是一个错误,所以提交了一个:github.com/meteor/meteor/issues/496
标签: internet-explorer-8 meteor handlebars.js