MouseEvent {dataTransfer: null, which: 1, toElement: div.jsCart, fromElement: null, y: 15…}
(function() {
var selectEls = document.querySelectorAll('.jsCart');
var clickToOrder = function(event) {
console.log(event);
event.target.classList.add('active');
};
for (var i = 0; i < selectEls.length; i++) {
var item = selectEls[i];
item.addEventListener('click', clickToOrder);
}
})();
function clickToOrder (e) {
e.target.classList.add('active');
console.log(this); // а это тот же e.target — вы же зачем-то вызывали bind()
};
module.exports = function(app) {
app.get('/', function(req, res) {
res.render('index');
});
// Прочие маршруты
}
require('./routes')(app);
require('routes')(app);
module.exports = function (app) {
app.get('/', function(req, res) {
res.render('index');
});
app.get('/user', function(req, res) {
res.render('user');
});
};
(function(){
})();
var myFunc = function($){
};
myFunc(jQuery);
#!/usr/bin/env node
CoffeeScript = require("coffee-script");
CoffeeScript.register();
create_app = require("../app/application");
app = create_app();
app.listen(5000);
console.log("Application running on http://localhost:5000/");
console.log("(" + process.env.NODE_ENV + " mode)");
gulp.task('coffee', function () {
return gulp.src(paths.src.coffee)
.pipe(coffee())
.pipe(concat('buildCoffee.js'))
.pipe(gulp.dest(paths.build.tmp));
});
<link rel="stylesheet" href="css.css" media="none" onload="if(media!='all')media='all'">
<noscript><link rel="stylesheet" href="css.css"></noscript>