473,387 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Detect if CSS file was loaded

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
Jul 20 '05 #1
2 8655


Yaron Cohen wrote:
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
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
Thanks Martin !
On Tue, 14 Oct 2003 16:25:52 +0200, Martin Honnen <ma*******@yahoo.de>
wrote:


Yaron Cohen wrote:
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


Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Etienne Charland | last post by:
Hi, I am trying to determine if the current OS supports alpha channel, to know which version of the icons to load. I have written code that detects Windows XP or later, and it works really well....
2
by: Jeff Lar | last post by:
I'm writing a class library that will be consumed by other applications, both web and form, and may also be loaded dynamically. I need the assembly to perform some validation immediately after it...
4
by: Mark | last post by:
I am loading source files into several iframes, with each load happening after some user-generated event (like clicking a button). The loading works but I need to determine when the source file is...
23
by: Michel Bany | last post by:
I am trying to parse responseXML from an HTTP request. var doc = request.responseXML; var elements = doc.getElementsByTagName("*"); the last statement returns an empty collection when running from...
1
by: Alex | last post by:
I need to detect if page loaded or not with a script (in a child frame). The IE has a special readyState function, is there anything similar for Mozila browsers? Is there a work around? Thank...
3
by: Asterbing | last post by:
Since the "on fly addition..." thread has taken another direction, I'm opening a new one to be more explicit and recenter the subject. Well, the subject is to detect when a document is well...
4
by: sid | last post by:
Can someone tell me how to detect "Action Cancelled" page with out polling. I have a frame set and I want to make sure the other frame is displaying what it is supposed to without polling. For...
2
by: Lambda | last post by:
I'd like to load a lot of data into a hashtable, when the memory is used up, I'll write the data to a file. I'm trying to use std::tr1::unordered_map to implement that. My question is if I...
13
by: Bob Altman | last post by:
Hi all, I have authored several native DLLs (call them A, B, and C). These libraries have references between each other (A calls B which calls C). These libraries are built and made available...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.