Modify ↓
Ticket #7522 (closed bug: worksforme)
Load external CSS in IE8
| Reported by: | znarkus@… | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.5 |
| Component: | unfiled | Version: | 1.4.4 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Hi!
Trying to load an external stylesheet, but can't get it to work in IE8. I've tried jQuery 1.4.2 and 1.4.4.
Tried all these different approaches below. Tried putting the code inside and outside of $(function(){. Tried putting it in <head> and last in <body>. Nothing works in IE8
$('<link rel="stylesheet" type="text/css" href="style.css" />').appendTo('head');
$('<style type="text/css">@import url("style.css")</style>').appendTo('head');
$('head').append(
$('<link/>', {
rel: 'stylesheet',
type: 'text/css',
href: 'style.css'
})
);
Change History
comment:1 Changed 3 years ago by snover
- Status changed from new to closed
- Resolution set to worksforme
comment:4 Changed 2 years ago by anonymous
It seems like it's only a problem with relative URLs. It "works for me" only if I supply an absolute URL for the css file.
comment:5 Changed 2 years ago by addyosmani
Testing using a relative URL and this seems to be working fine as well. http://jsfiddle.net/addyosmani/vs5NC/
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

test case works for me.