Bu adminlarni shaxsiy ishi aslida asosiysi kod emas mijoz uchun dom load qiziqroq. Oddiy odam injener emas. Js va CSS alohida faylga olib kerakli joyda yuklash uchun script
function loadJS(pageScript) {
var body = document.getElementsByTagName('body')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.async = false;
script.src = pageScript;
body.appendChild(script);
}
function loadCSS(cssFile) {
var head = document.getElementsByTagName('head')[0];
var s = document.createElement('link');
s.setAttribute('rel', 'stylesheet');
s.setAttribute('type', 'text/css');
s.setAttribute('href', cssFile);
s.onload = callback;
head.appendChild(s);
}
scriptni ishlatish uchun
<script>
loadJS("sample.js");
loadCSS("sample.css");
</script>