Skip to main content

Bug Tracker

Side navigation

#7522 closed bug (worksforme)

Opened November 15, 2010 01:42PM UTC

Closed November 17, 2010 04:04AM UTC

Last modified March 13, 2012 04:52PM UTC

Load external CSS in IE8

Reported by: znarkus@gmail.com 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/

Attachments (0)
Change History (5)

Changed November 17, 2010 04:04AM UTC by snover comment:1

resolution: → worksforme
status: newclosed

test case works for me.

Changed November 21, 2010 12:07AM UTC by snover comment:2

#5819 is a duplicate of this ticket.

Changed March 23, 2011 08:46AM UTC by netrunner comment:3

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

Changed April 06, 2011 01:22PM UTC by anonymous comment:4

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.

Changed April 16, 2011 05:47AM UTC by addyosmani comment:5

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