के साथ requjs का उपयोग कैसे करें I needjs के साथ काम करने के लिए zepto नहीं लग रहा है।zepto
यहाँ मेरी फ़ाइलें
main.js
require.config({
paths: {
zepto: 'libs/zepto/zepto.min',
underscore: 'libs/underscore/underscore-min',
backbone: 'libs/backbone/backbone-min',
cordova: 'libs/cordova/cordova-2.1.0',
history: 'libs/history/history',
historyZ: 'libs/history/history.adapter.zepto'
},
shim: {
zepto: {
exports: '$'
},
backbone: {
deps: ['underscore', 'zepto']
}}
});
require([
// Load our app module and pass it to our definition function
'app',
], function(App){
// The "app" dependency is passed in as "App"
App.initialize();
});
app.js
define([
'zepto',
'underscore',
'backbone',
'router' // Request router.js
], function($, _, Backbone, Router){
var initialize = function(){
// Pass in our Router module and call it's initialize function
Router.initialize();
}
return {
initialize: initialize
};
});
router.js हैं
define([
'zepto',
'underscore',
'backbone',
'views/dashboard'
], function($, _, Backbone, DashboardView){
var AppRouter = Backbone.Router.extend({
routes: {
// Define some URL routes
'' : 'showDashboard',
}
});
var initialize = function(){
var app_router = new AppRouter;
app_router.on('showDashboard', function(){
// We have no matching route, lets just log what the URL was
//console.log('No route:', actions);
var dashboardView = new DashboardView();
dashboardView.render();
});
Backbone.history.start();
};
return {
initialize: initialize
};
});
आप चित्र प्राप्त .. लेकिन जब मैं यह सब चलाता हूं, मुझे यह क्रोमस कॉन में मिलता है एकमात्र:
GET http://localhost/SBApp/www/js/jquery.js 404 (Not Found) require.js:1824
और एक स्क्रिप्ट त्रुटि (मैं कोष्टक में फेंक दिया बीसी यह मेरे पोस्ट जाने नहीं होगा।)
और फ़ायरबग साथ Firefox में, यह एक scripterror
किसी को भी सफलता को विन्यस्त किया गया है बाहर थूक Zepto आवश्यकता के साथ और मुझे कुछ मदद फेंक सकते हैं?
आप "jQuery" का कोई उल्लेख के लिए अपने libs और स्रोत grep किया? ऐसा लगता है कि कोई भी lib स्वतंत्र रूप से इसे शामिल करने का प्रयास करेगा। – numbers1311407
मैंने किया और jQuery की संदर्भित एकमात्र चीज की आवश्यकता थी।मुझे लगता है कि जब मैं इसके साथ एएमडी का उपयोग करने की कोशिश करता हूं, तो यह इसके लिए देखता है और मैं थोड़ा सा देख रहा हूं कि ज़ेप्पो और एएमडी के लिए अभी तक कोई समर्थन नहीं है? –