Bug Tracker

Modify

Ticket #7522 (closed bug: worksforme)

Opened 3 years ago

Last modified 15 months ago

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

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

Change History

comment:1 Changed 3 years ago by snover

  • Status changed from new to closed
  • Resolution set to worksforme

 test case works for me.

comment:2 Changed 3 years ago by snover

#5819 is a duplicate of this ticket.

comment:3 Changed 2 years ago by netrunner

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

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.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.