简体   繁体   中英

how to load javascript before css

I have displayed a loading bar before the entire page is loaded on my website.
Here is the js which i am using
JsBin demo

Now the problem is when some one opens the web page , black background (css) appears and after 2-3 seconds loading bar shows the loading. Though this is the first script which loads on the website.
Why loading bar gets delay. How can i load it dynamically ?
This is my website . Script name is javatest.js
Sorry if i missed anything , i am just a newbie

Based on your comments it looks like you're after loading CSS via your JavaScript. This has been answered here . I'm not sure if this will work with JSBin or not, so I suggest you test this in notepad or something else.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM