Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to append value from textarea to another view using backbone.js?
    text
    copied!<p>I am beginner to backbone.js.</p> <p>Actually i am developing chat application.</p> <p>I given textarea to user to type a message and and i want when user clicks on send then that message should get appended to upper div which i specified.</p> <p>how this can get achieved using backbone.js? please see below code for textarea and submit button: </p> <pre><code>&lt;textarea name="message" cols="20" rows="4" id="usermessage" &gt;&lt;/textarea&gt; &lt;input name="submitmessage" type="submit" id="submitmessage" value="Send" /&gt; </code></pre> <p>please see below code for chathistory view : </p> <pre><code>&lt;div id="chatHistory"&gt;&lt;/div&gt; </code></pre> <p>I want to achieve this only using backbone.js. please help....</p> <pre><code>window.ChatHistoryView = Backbone.View.extend({ initialize: function(){ this.render(); }, render: function(){ // Compile the template using underscore var template = _.template( $("#chat_History").html(), {} ); // Load the compiled HTML into the Backbone "el" this.$el.html( template ); }, events: { // "click input[type=button]": "doSearch" }, }); window.ChatInputView = Backbone.View.extend({ initialize: function(){ this.render(); }, render: function(){ // Compile the template using underscore var template = _.template( $("#chat_Input").html(), {} ); // Load the compiled HTML into the Backbone "el" this.$el.html( template ); }, events: { "click input[type=submit]": "updateChatHistory" }, updateChatHistory: function( event ){ this.chatHistoryView.$e1.append(); app.navigate('', true); window.history.back(); } </code></pre> <p>Please check and help me to solve this...</p>
 

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