Detect if CSS file was loaded

Y

Yaron Cohen

Hi,


I would like to ask for your help.

It seem that sometimes an external CSS file on my page is not loaded,
result with bad layout to my page.

Refresh solve the problem.

I would like to check if the CSS file was successfully loaded and if
not then refresh the page.


I know how to do it to external JS file (using typeof) but how can I
check if CSS file was loaded.

if there is something like "typeof className" ?

I am using IE 5.5


Thanks,

Yaron
 
M

Martin Honnen

Yaron said:
Hi,


I would like to ask for your help.

It seem that sometimes an external CSS file on my page is not loaded,
result with bad layout to my page.

Refresh solve the problem.

I would like to check if the CSS file was successfully loaded and if
not then refresh the page.


I know how to do it to external JS file (using typeof) but how can I
check if CSS file was loaded.

if there is something like "typeof className" ?

I am using IE 5.5

There is
document.styleSheets.length
which you could check but I don't know whether its value will reflect
what you think is a stylesheet not being loaded
 
Y

Yaron Cohen

Thanks Martin !


There is
document.styleSheets.length
which you could check but I don't know whether its value will reflect
what you think is a stylesheet not being loaded
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top