Note that there are some explanatory texts on larger screens.

plurals
  1. POsimple page with backbone using eclipse
    primarykey
    data
    text
    <p>Hello i would like to create a simple page using Backbone with eclipse environment. i want to create all the files seperately. like html file seperately and template(hogan) file seperately and backbone file seperately.. when i did this it the pages are not rendering..</p> <p>i created all the files seperately in different folders. i want to call the template in my backbone page and render it to the html page..</p> <p>my htmlpage is </p> <pre><code> &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="UTF-8" content-type:application/javascript&gt; &lt;title&gt;Welcome&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;Welcome&lt;/h1&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/template" src = "js/templ" id ="search_template" &gt;&lt;/script&gt; &lt;script src = "js/1.js"&gt;&lt;/script&gt; &lt;div id = "search_container"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>my Backbone page is </p> <pre><code>/** * New node file */ SearchView = Backbone.View.extend({ initialize: function(){ this.render(); }, render: function(){ // Compile the template using underscore var template = _.template( $("#search_template").html(), {} ); // Load the compiled HTML into the Backbone "el" this.$el.html( template ); } }); var search_view = new SearchView({ el: $("#search_container") }); </code></pre> <p>my template page is</p> <pre><code>&lt;script type="text/html" id="search_template"&gt; &lt;label&gt;Search&lt;/label&gt; &lt;input type="text" id="search_input" /&gt; &lt;input type="button" id="search_button" value="Search" /&gt; &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload