smuggledPancakes
smuggledPancakes

Reputation: 10333

Stuck on simple Ember.js example, I do not think my javascript files are being used

At http://emberjs.com/ I am try to get the auto-updating and handlebars templates example working, it is the first one. When I run it, my html page look like:

Name: {{input type="text" value=name placeholder="Enter your name"}}
My name is {{name}} and I want to learn Ember!

It is just plain text, it is not like how it looks on the ember website.

This means I am not loading my javascript files right? Here is my code:

<!DOCTYPE html>
<html>
<head>
  <title>EmberDemo</title>
  <script src="./js/jquery-1.10.2.js" type="text/javascript"></script>
  <script src="./js/handlebars-1.1.2.js" type="text/javascript"></script>
  <script src="./js/ember-1.5.1.js" type="text/javascript"></script>
  <script src="./js/app.js" type="text/javascript"></script>

</head>
<body>

<div>
 <label>Name:</label>
 {{input type="text" value=name placeholder="Enter your name"}}
</div>
<div class="text">
<h1>My name is {{name}} and I want to learn Ember!</h1>
</div>

</body>
</html>

Here is my path in Eclipse for where my javascript files live. /EmberQuickstart/src/main/webapp/js/

My path for my index.html is /EmberQuickstart/src/main/webapp/index.html

Can anybody tell me what is wrong? I am really stumped. I should not need a webserver and a war file to get javascript to work right?

Update Malik I changed my paths to what you said and I appear to be on the right track, but it is still not working. Here is my console output in Chrome's developer tools:

DEBUG: ------------------------------- ember-1.5.1.js:3521
DEBUG: Ember      : 1.5.1 ember-1.5.1.js:3521
DEBUG: Handlebars : 1.1.2 ember-1.5.1.js:3521
DEBUG: jQuery     : 1.10.2 ember-1.5.1.js:3521
DEBUG: ------------------------------- ember-1.5.1.js:3521
Ember Debugger Active 

Upvotes: 0

Views: 169

Answers (3)

Asif Mehmood
Asif Mehmood

Reputation: 984

Remove the ./ part in your src="".

You should write it as:

src="js/jQuery    "

Upvotes: 1

Jose Perales
Jose Perales

Reputation: 56

I recommend to use Ember-Cli to start is easy and super complete Ember-Cli

Upvotes: 0

smuggledPancakes
smuggledPancakes

Reputation: 10333

I figured it out. I am 100% new to handlebars and ember so I did not realize that I need a tag to surround my topmost . Now it works!

Upvotes: 0

Related Questions