Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Backbone Render

/*render is where we set each view's html*/
/*this.$el.html() means each unit will have a html of <b> xyz</b> no matter what I type*/
/*the console.log of $el here will yield Object{"0": {},"context": {},  "length": 1}*/
/*this.input will console log Object { length: 0, prevObject: {…}, context: li, selector: ".edit" }*/
/*this will console log-> cid: "view2", model: {…}, options: {…}, "$el": {…}, el: li, input: {…} */
/*the initialize and render parts execute each time you add a new one of these views*/
/*this.input is:  Object { length: 0, prevObject: {…}, context: li*/
app.TodoView = Backbone.View.extend({
      tagName: 'li',
      template: _.template($('#item-template').html()),
      render: function(){
        this.$el.html("<b>xyz</b>");
        /*adding this.$el.html("HELLO WORLD") would override the above...instead of <b>xyz</b> it will become HELLO WORLD*/
        this.input = this.$('.edit');
        return this; // enable chained calls
      },
  /*...*/
      
Comment

PREVIOUS NEXT
Code Example
Javascript :: simple express server responce html css js 
Javascript :: Backbone View El 
Javascript :: JSON of first block in cryptocurrency blockchain 
Javascript :: Backbone Model And Collection 
Javascript :: react creating function to call API in app: calling APIs after render w error message 
Javascript :: how to set javascript load order in html 
Javascript :: name of javascript virtual machine for apple 
Javascript :: Backbone Router Notes 
Javascript :: file path to blob javascript 
Javascript :: adding javascript object within array 
Javascript :: Solution-2--solution options for reverse bits algorithm js 
Javascript :: remove duplicate node 
Javascript :: js onclick add table row 
Javascript :: ng-options angularjs 
Javascript :: convert 12 hour to 24 hour javascript 
Javascript :: polymorphism js 
Javascript :: find an element 
Javascript :: javascript add item to array 
Javascript :: nextjs apollo client 
Javascript :: ajax get request javascript 
Javascript :: how to convert string to random case in javascript 
Javascript :: javascript DOM SELECT 
Javascript :: JavaScript for loop Display Numbers from 1 to 5 
Javascript :: javascript Rename in the module 
Javascript :: javascript "use strict" 
Javascript :: actionscript round roundnumber 
Javascript :: chart js svg word map 
Javascript :: how to send the captured image from js to python backedn flask 
Javascript :: phaser random ellipse 
Javascript :: react-native-fbsdk-next 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =