Según el sitio web backbone.js: única dependencia dura¿Tiene Backbone.js una fuerte dependencia de jQuery?
de Backbone es Underscore.js (> 1.3.1). Para la persistencia RESTful, soporte de historial a través de Backbone.Router y DOM manipulación con Backbone.View, incluyen json2.js, y jQuery (1.4.2) o Zepto.
He probado con el código siguiente, la eliminación de jQuery y la vista Backbone arroja un error.
<html>
<head>
<title>asda</title>
<!--<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>-->
<script src="http://documentcloud.github.com/underscore/underscore.js"></script>
<script src="http://documentcloud.github.com/backbone/backbone.js"></script>
<script type="text/javascript" charset="utf-8" async defer>
SearchView = Backbone.View.extend({
initialize: function(){
alert("Alerts suck.");
}
});
// The initialize function is always called when instantiating a Backbone View.
// Consider it the constructor of the class.
var search_view = new SearchView;
</script>
</head>
<body>
</body>
</html>
¿Cómo pueden funcionar Backbone.View y Backbone.Router sin jQuery?
también 'Backbone.Router' depende de jQuery/Zepto ... – drinchev
posibilidades de no utilizar la vista y el router es suficientemente bajo. Estaría mejor justificado, confíe en jquery/zepto. – TonyTakeshi