Detect if CSS file was loaded

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yaron Cohen

    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
  • Martin Honnen

    #2
    Re: Detect if CSS file was loaded



    Yaron Cohen wrote:
    [color=blue]
    > 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[/color]

    There is
    document.styleS heets.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


    Comment

    • Yaron Cohen

      #3
      Re: Detect if CSS file was loaded

      Thanks Martin !


      On Tue, 14 Oct 2003 16:25:52 +0200, Martin Honnen <mahotrash@yaho o.de>
      wrote:
      [color=blue]
      >
      >
      >Yaron Cohen wrote:
      >[color=green]
      >> 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[/color]
      >
      >There is
      > document.styleS heets.length
      >which you could check but I don't know whether its value will reflect
      >what you think is a stylesheet not being loaded[/color]

      Comment

      Working...