Commit fe88f97d authored by Nikolay Gromov's avatar Nikolay Gromov

Глобальный JS-файл: подпилил заготовку

parent 04dc9b30
/* global document module */
const ready = function (fn) {
if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading"){
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
module.exports = ready;
// Если на проекте jQuery // var ready = require('./documentReady.js');
// var $ = require('jquery');
// $( document ).ready(function() {
// // code
// });
// Изоляция без jQuery
// (function(){
// // code
// }());
// На проекте нет jQuery, но хочется $( document ).ready...
// function ready(fn) {
// if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading"){
// fn();
// } else {
// document.addEventListener('DOMContentLoaded', fn);
// }
// }
//
// ready(function(){ // ready(function(){
// // code // console.log('DOM героически построен!');
// }); // });
// Взять целевой файл // var $ = require('jquery');
// require('./some-file.js'); // $( document ).ready(function() {});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment