Skip to content

Instantly share code, notes, and snippets.

@olsonjeffery
Created December 20, 2010 22:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olsonjeffery/749108 to your computer and use it in GitHub Desktop.
Save olsonjeffery/749108 to your computer and use it in GitHub Desktop.
issue with backbone + zepto in ff 3.6
The Error:
element["insertAdjacent" + (html instanceof Element ? "Element" : "HTML")] is not a function
http://localhost:8080/scripts/zepto.js
Line 145
the zepto.js is 5ecaa (HEAD of the zepto repo)
backbone.js is 261059 (HEAD of backbone's repo)
the stack looks like..
during model intiailization in the $() handler, loading models from
json passed from the server-side view.. calling down from Collection.add
to a master view's listener for the collection's 'add' event.. into zepto
via $() .. the last line of my application code before going into the
offending part of zepto looks like:
this.$('#dishes_list').append(view.render().el);
the #dishes_list is a <ul>, to which I'm appending the content of a view (with tagName: 'li');
verified working w/o error in jquery 1.4.4
@drewlesueur
Copy link

Are you using a Webkit browser (Safari or Chrome) ?

@olsonjeffery
Copy link
Author

no this is in ff 3.6

@drewlesueur
Copy link

According to Thomas Fuchs, creator of Zepto:

Zepto is webkit-only for now

That's why it's not working. See https://github.com/madrobby/zepto/issues#issue/45

@drewlesueur
Copy link

Someone should create a Firefox (gecko) based version so we could have something like:

 <script src="zepto.js" />
 <script src="zepto.gecko.js" />

@olsonjeffery
Copy link
Author

hmm. bummer. i just tested it in chrome and seems to work, but some other stuff is failing. fun!

@drewlesueur
Copy link

Yea. That's one reason why Zepto is so small. Because it doesn't have to worry about cross browser support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment