Thursday, December 01, 2016

JSBin.com not working with Backbone

 Don't we all love JS Bin?  Yes!
But to get backbone to work takes a little extra.
Using the default libraries I get this error:

"error"
"Script error. (line 0)"
"error"
"@nuhipe.js:17:10

But if you replace JSBin's imported javascript libraries:

 
<script src="//jashkenas.github.io/underscore/underscore-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.2/backbone-min.js"></script>

with these in the head element:
 

<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<script src="https://cdn.jsdelivr.net/lodash/3/lodash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.2/backbone-min.js"></script>
<script src="//jashkenas.github.io/underscore/underscore-min.js"></script>


JSBin works like a charm.