3

I am receiving this error message when including backbone in my application,

Uncaught TypeError: Object [object DOMWindow] has no method 'set'

but I have jquery (1.4.4) and underscore.js (1.1.7) loaded before backbone, why is this method still missing?

Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
x0rist
  • 625
  • 4
  • 9
  • there might be a clash between the javascript libraries, try using the `noConflict` – Rafay Sep 30 '11 at 19:30
  • Does backbone.js work with that older version of jQuery? I've never tried. No conflict doesn't have anything to do with this issue unless there is another library being included other than jQuery. underscore.js does not conflict with jQuery. – Kevin B Sep 30 '11 at 20:55
  • On which line of which code does this error occur? Could you post some code please?? – PhD Oct 01 '11 at 08:27

2 Answers2

5

Or you are instantiating a model without new prefix which would cause it to be bound to global window instead of this. SO reference.

Community
  • 1
  • 1
Davor Lucic
  • 28,970
  • 8
  • 66
  • 76
1

Based solely on the error message, I would search your code for this.set. It appears that you're referencing thiswith the expectation that it's a model, but the function isn't bound correctly.

fearphage
  • 16,808
  • 1
  • 27
  • 33