CSS not parsed on IE7 with base tag and relative URLs #137

Open
undsoft opened this Issue Jun 25, 2012 · 7 comments

Comments

Projects
None yet
4 participants

undsoft commented Jun 25, 2012

Hi,

I was testing respond.js on my webpage and found that it does nothing on IE7.

I was able to narrow the issue.

My page uses tag and all other tags have relative URLs.
The problem is in the ripCSS() method - it does not make any requests.

This line:

(!/^([a-zA-Z:]*\/\/)/.test( href ) && !base) || href.replace( RegExp.$1, "" ).split( "/" )[0] === win.location.host 

The thing is that IE8 has full url in href variable and IE7 has only the relative URL i put there:
IE8:
http://site.com/css/prime.css

IE7:
css/prime.css

ph0b0s commented Jun 28, 2012

I got this problem too!

How did you solve this?

undsoft commented Jun 28, 2012

The dirty solution is here:
#138

It works but it creates extra requests.

Maybe you can turn it into a beauty.

ph0b0s commented Jun 28, 2012

This works for me:
#139

Check your actual base tag. I spent a long time this afternoon chasing this issue with the latest minified version only to find I was missing a trailing / on my base tag

gitaarik commented Jan 3, 2013

I spend a lot of time today too to find this was a base tag issue. I just fixed it by making the paths to the stylesheets absolute.

Maybe we can update the Support & Caveats section of the README to warn people about it for now? Untill it's possibly fixed?

I have found after much playing, that setting the Base tag on the Server-side is a handy fix for several issues like this.

I use this in PHP -

<base href="http://<?php echo $_SERVER['HTTP_HOST']; ?>/">

If you are .net, ruby etc I am sure there is an equivalent.

gitaarik commented Jan 3, 2013

Hey dave,

I've tried several things with the basetag, but in IE7 I can't get it working, are you sure it works for you in IE7?

@aschempp aschempp referenced this issue in contao/core Nov 21, 2013

Closed

Contao 3.x nicht mit IE 7 kompatibel #6068

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment