Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we force ZURB Foundation 4 to use jQuery only, and not Zepto?

I am building a project using jQuery. I put in a manual reference to jQuery in ZURB Foundation 4.

I also removed

<script>
    document.write('<script src=' +
                   ('__proto__' in {} ? 'js/vendor/zepto' : 'js/vendor/jquery') +
                   '.js><\/script>')
</script>

from the default ZURB Foundation 4 implementation.

Is that okay? Or will removing the above code cause issues elsewhere in ZURB Foundation 4?

In other words, can we force ZURB Foundation 4 to use jQuery only, and not break it?

like image 610
Azure Avatar asked Apr 27 '13 13:04

Azure


2 Answers

The snippet will always load either jQuery or Zepto, never both. So yes, of course you can only use jQuery.

Zepto is a jQuery clone with fewer features, thus it is much smaller in file size. The only reason for them to still use jQuery is that Zepto doesn't have any support for any version of Internet Explorer.

They also explain it in the documentation:

Foundation JavaScript was designed to work with Zepto and jQuery right out of the gate. Zepto is not supported by all browsers, so as suggested in the Zepto documentation, you should test for compatibility and load Zepto or jQuery as necessary.

like image 56
jgillich Avatar answered Oct 12 '22 12:10

jgillich


Just as an update, this past January 2014, Zurb announced it was dropping Zepto in favor of jQuery 2 with their release of Foundation 5.

As they determined "... lighter file size did not translate into better performance overall," and that "... jQuery 2 has more operations per second."

  • http://zurb.com/article/1293/why-we-dropped-zepto
like image 37
Timothy Petrakis Avatar answered Oct 12 '22 12:10

Timothy Petrakis