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?
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.
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."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With