CodeIgniter Forums
Paths in page work fine with FF and Chrome but break under IE. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Paths in page work fine with FF and Chrome but break under IE. (/showthread.php?tid=37556)



Paths in page work fine with FF and Chrome but break under IE. - El Forum - 01-13-2011

[eluser]pocketmax[/eluser]
Check this out...

[disabled].com

Load the site in FF and Chrome and it works fine. But in IE6, all the links (all relative) break. What gives? I checked my config and everything works fine.


Paths in page work fine with FF and Chrome but break under IE. - El Forum - 01-13-2011

[eluser]CroNiX[/eluser]
Have you tried using real links instead of javascript? Your site won't even work if js is turned off...


Paths in page work fine with FF and Chrome but break under IE. - El Forum - 01-13-2011

[eluser]pocketmax[/eluser]
I'm not talking about the heading links. I'm talking about everything. CSS, js includes, images etc etc. That stuff is just normal html like
Code:
<img src="/something.gif">



Paths in page work fine with FF and Chrome but break under IE. - El Forum - 01-13-2011

[eluser]stuffradio[/eluser]
I'm not seeing any problems right now, but for one thing you mentioned IE 6. Don't even bother supporting that old thing.


Paths in page work fine with FF and Chrome but break under IE. - El Forum - 01-13-2011

[eluser]pocketmax[/eluser]
But isn't IE6 still the most popular microsoft web browser? Granted there is still IE7 and IE8 but not everyone has migrated to either of those yet.


Paths in page work fine with FF and Chrome but break under IE. - El Forum - 01-13-2011

[eluser]cideveloper[/eluser]
I guarantee your "&lt;base&gt;" tag is screwing things up.

try this

Code:
&lt;base href="/"&gt;&lt;!--[if lte IE 6]>&lt;/base&gt;&lt;![endif]--&gt;

Edit: I hate ie6 and refuse to support it. Eventually clients come around when they see the cool stuff you can do with a modern browser.


Paths in page work fine with FF and Chrome but break under IE. - El Forum - 01-13-2011

[eluser]pocketmax[/eluser]
I just deleted the &lt;base&gt; tag and everything worked!! That base tag is satin!!! Why would anyone use such a thing? It seems to be totally pointless especially when other browsers and future versions of IE don't need it at all.


Paths in page work fine with FF and Chrome but break under IE. - El Forum - 01-13-2011

[eluser]cideveloper[/eluser]
I guess if you want your relative links not to be relative to the page you are on

EXPLANATION


Paths in page work fine with FF and Chrome but break under IE. - El Forum - 01-13-2011

[eluser]pocketmax[/eluser]
Ahhh.. that clears it up. Thanks for the tip.


Paths in page work fine with FF and Chrome but break under IE. - El Forum - 01-13-2011

[eluser]Atharva[/eluser]
It is always better to use
Code:
base_url()
while accessing your assets (js/css/images etc) rather than relative urls in my view.