So, I am creating a basic view using Backbone, and when I go to run it, I get this TypeError:
Uncaught TypeError: Right-hand side of instanceof is not an object
The error is referencing multiple points inside the backbone.min.js
file and line 18 in my program. Here is the code:
<!DOCTYPE HTML>
<HTML>
<HEAD>
<META CHARSET="UTF-8" />
<TITLE>First View</TITLE>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min.js"></script>
<SCRIPT LANGUAGE="Javascript">
var PokeView = Backbone.View.extend({
render: function() {
this.$el.html("Simisage");
return this;
}
});
var myPokeView = new PokeView({ el: "#paragraph" });
console.log(myPokeView instanceof Object);
myPokeView.render();
</SCRIPT>
</HEAD>
<BODY>
<p id="paragraph"></p>
</BODY>
I have been looking all over the internet and some people have encountered the same error, but it isn't related to Backbone. Is the solution for Backbone the same as the others? How can I fix this?