xmoonlight / includehtml Goto Github PK
View Code? Open in Web Editor NEWincludeHTML - Include HTML DOM nodes/parts (loading) via HTML tag into HTML-page for templates and SPA (pure js)
License: Other
includeHTML - Include HTML DOM nodes/parts (loading) via HTML tag into HTML-page for templates and SPA (pure js)
License: Other
А если у нас будет таких секций штук 12-15 и мы перейдем на страницу по якорю #section13
то не факт, что к этому моменту секция прогрузится.
Мб добавить опцию какой-нибудь проверки, чтобы проверяло передан ли якорь, который соответствует подгружаемой секции.
Еще не совсем понятен такой момент:
опять страница 10-15 блоков, переходим на 12 блок, а несколько предыдущих еще не подгружены, когда подгрузятся, то на странице собьется скролл. Как быть в данной ситуации?
and minified version ;)
includeHTML('header.html', document.getElementById('mainmenu'), function(){
includeHTML('menu.html', document.getElementById('pagemenu'));
});
Это callback hell, а не sync ;)
Может promises? или массивом/объектами передавать нужное и оно там уже само внутри себя callback hell устроит?
например:
includeHTML.sync([
['header.html', 'mainmenu'], ['main.html', 'main'], ['menu.html', 'pagemenu']
]);
npm license CC BY-SA 4.0 is not a valid license
maybe change it to MIT?
when I define header.html.
It contains a tag, When I introduced to index.html , a tag click don't work.
maybe I lose correct useage.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.