BACKBONE.JS trigger function backbone.sj - Net-Raft.com

Welcome aboard! We are happy you are here and wish you good net-raft!




Just a Web Code Solution
join us

How can I trigger a function in backbone.sj?


 448

Show ResultBACKBONE.JS


1

<!DOCTYPE html>
<html>
<head>

<script src="https://code.jquery.com/jquery-2.1.3.min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.2/underscore-min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.2/backbone-min.js" type="text/javascript"></script>

<script type="text/javascript">

function test() {

var myVal = _.extend({name:'Hello..'}, Backbone.Events);
var myVal1 = _.extend({name:'Welcome to Net-Raft.com!'}, Backbone.Events);

var listenMe = function(){

$("#div1").append("The value is: ");
$("#div1").append(this.name);

};

myVal1.listenTo(myVal, 'listenMe', listenMe);

myVal.trigger('listenMe');

}

</script>

</head>
<body>

<button onclick="test()">click</button>

<hr>

<div>Result:</div>

<hr>

<div id="div1"></div>

</body>
</html>


By        
The power of the user (%)
13%



The most helpful BACKBONE.JS solutions

How to get country from client ip address using backbonejs ?How to get country from client ip address using backbonejs ?BACKBONE.JS

Click to see more ...

  822     84

How to bind callback to only fire once before being removed using backbone.js ?How to bind callback to only fire once before being removed using backbone.js ?BACKBONE.JS

Click to see more ...

  620     66

How to detect the type of a device using backbonejs ?How to detect the type of a device using backbonejs ?BACKBONE.JS

Click to see more ...

  515     59

How to detect the version of IE browser using backbonejs ?How to detect the version of IE browser using backbonejs ?BACKBONE.JS

Click to see more ...

  364     53

How to detect mobile device not tablet using backbonejs ?How to detect mobile device not tablet using backbonejs ?BACKBONE.JS

Click to see more ...

  368     51

How to get clients latitude and longitude from ip address using backbonejs ?How to get clients latitude and longitude from ip address using backbonejs ?BACKBONE.JS

Click to see more ...

  401     48

How can I trigger a fucntion using backbone.js ?How can I trigger a fucntion using backbone.js ?BACKBONE.JS

Click to see more ...

  227     46

How can I trigger a function in backbone.sj?How can I trigger a function in backbone.sj?BACKBONE.JS

Click to see more ...

  448     42

How can I trigger multiple functions using backbone.js ?How can I trigger multiple functions using backbone.js ?BACKBONE.JS

Click to see more ...

  312     39

How set and get a value in backbone.js ?How set and get a value in backbone.js ?BACKBONE.JS

Click to see more ...

  198     36

Welcome aboard!
We are happy you are here and
wish you good net-raft!