Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#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:
Blocked by: Blocking:

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'
	})
);

http://www.labs.mimmin.com/jquery/bug-css/

Change History (5)

comment:1 Changed 9 years ago by snover

Resolution: worksforme
Status: newclosed

test case works for me.

comment:2 Changed 9 years ago by snover

#5819 is a duplicate of this ticket.

comment:3 Changed 9 years ago by netrunner

Can I reopen this bug, or do I need to create a new one?

comment:4 Changed 9 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 9 years ago by addyosmani

Testing using a relative URL and this seems to be working fine as well. http://jsfiddle.net/addyosmani/vs5NC/

Note: See TracTickets for help on using tickets.