Why can't I use relative URLs with IE7?

Posted by gomezuk on Stack Overflow See other posts from Stack Overflow or by gomezuk
Published on 2010-05-05T15:49:53Z Indexed on 2010/05/05 15:58 UTC
Read the original article Hit count: 213

Hello everyone. I've been Googling for a while and can't seem to find an answer to this question. My problem is as follows:

For my jquery, I need my links to be relative rather than absolute. My PHP is set to return relative urls and everything is working fine, until I test it in IE7. For some reason, IE7 keeps changing my relative urls to abosulute, which breaks my js script. Is this normal? Is there a way to get around it?

For example:

IE8, Chrome, Firefox, Safari etc -

<a href='/page' onclick='click_handler(this);return false;'>clicky</a>

IE7 -

<a href='http://www.myurl.com/page' onclick='click_handler(this);return false;'>clicky</a>

© Stack Overflow or respective owner

Related posts about html

Related posts about ie7