我是新來Ember.js。 我希望把重點放在文本字段(樣品ID =「文本」)初始化後, 但功能齊全,不工作的重點方法...如何使用emberjs進行初始化後進行對焦?
<body>
<!-- library load -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="js/libs/jquery-1.6.1.min.js"%3E%3C/script%3E'))</script>
<script src="http://cloud.github.com/downloads/emberjs/ember.js/ember-0.9.5.min.js"></script>
<script type="text/x-handlebars">
{{view Em.TextField id="text"}} // want to focus it.
</script>
<script type="text/javascript">
var App = Em.Application.create();
App.ready = function() {
$('#text').focus(); // does'nt work.
}
</script>
</body>
也http://stackoverflow.com/questions/12557584/how-to-use-autofocus-with-ember-js-templates/12560551#12560551見關於HTML5的解決方案。 – rit 2012-09-25 06:30:13