I'm been having some trouble playing around with the backbone.js library recently - namely the variables that I instantiate (both an extended View and Model) remain undefined.
Here's some code to show you what I mean:
<script type="text/javascript">
$(document).ready(function(){
var img = new ImageUrl();
var search = new ImageSearchDialogue({el: '.imageUrl', model: img}).render();
});
</script>
Here's the script that I've placed in the HTML document - both variables are undefined however. (I've checked with Firebug)
Is this a scoping issue perhaps?
ImageUrlextends aBackbone.Modeland theImageSearchDialogueextends aBackbone.View? Also the Backbone and Jquery libraries have been included in the page?