【发布时间】:2015-01-02 11:03:04
【问题描述】:
我的 index.html 代码是
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/one.css">
</head>
<body>
<!--Script1-->
<script type="text/x-handlebars">
<div id="W">
<h1> Welcome </h1>
</div>
<div id="section1">
<h2> {{#link-to 'DINESH'}} DINESH {{/link-to}} </h2>
</div>
<div id="section">
<h2> {{#link-to 'HOME'}} HOME {{/link-to}} </h2>
</div>
<div id="section2">
<h2> {{#link-to 'CLICK'}} CLICK {{/link-to}} </h2>
</div>
{{outlet}}
</script>
<!--Script2-->
<script type="text/x-handlebars" id='HOME'>
<div class-'HOME'>
<p>
This is a sample site for practicing Ember.js
</p>
</script>
<!--Script3-->
<script type="text/x-handlebars" id='DINESH'>
<div class-'DINESH'>
<p>
I welcome you to my page.. keep in touch......!!!!!
</p>
VIDIYAL
<br>
Being the "Director of Community Service" in Rotaract Club of Future League, I organised a project called "VIDIYAL" where i taught basic computer knowledge to Orphanage Students.
</script>
<!--Script4-->
<script type="text/x-handlebars" id='CLICK'>
<div class-'CLICK'>
<p> Click the button to display the information which you want: </p>
<button onclick="myFunction()">Click me</button>
<p id="CLICK"></p>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Hello World";
}
</script>
<script src="js/libs/jquery-1.10.2.js"></script>
<script src="js/libs/handlebars-v2.0.0.js"></script>
<script src="js/libs/ember-1.9.1.js"></script>
<script src="js/app.js"></script>
<!-- to activate the test runner, add the "?test" query string parameter -->
<script src="tests/runner.js"></script>
</body>
</html>
app.js 代码是
App = Ember.Application.create();
App.Router.map(function()
{
this.resource('HOME');
this.resource('DINESH');
this.resource('CLICK');
});
如果我点击它应该会显示一个弹出窗口,询问我的名字(“输入你的名字”)。
我是一名对编程非常陌生的学生。所以请尽可能简单地解释我。
【问题讨论】:
-
你可以使用prompt
-
亲爱的 MLeFevre,谢谢,但我应该在哪里添加该代码?而且我不需要为它创建任何模型?
标签: javascript jquery html json ember.js