S
Soren Vejrum
I am working on a web-based html editor using MSIE's designmode and
iframes.
Everything works just fine, but MSIE changes all my relative "a href"
and "img src" links (i.e. "/index.asp") to absolute links (i.e.
"http://localhost/index.asp") when I set the iframe's innerHTML.
This is bad as the links are supposed to be relative. How can I avoid
this? Any solutions/suggestions are much appreciated.
- This (setting the innerHTML) works just fine in Mozilla/Netscape.
- I have tried to create a selection/range and use "pasteHTML" instead
but the result is the same.
- I have tried to set the "html head base href" in the initial
document loaded by the iframe but the result is the same.
Example:
myiframe.contentWindow.document.body.innerHTML = '<a
href="/index.asp">xxx</a>';
alert(myiframe.contentWindow.document.body.innerHTML);
Output:
<a href="http://localhost/index.asp">xxx</a>
iframes.
Everything works just fine, but MSIE changes all my relative "a href"
and "img src" links (i.e. "/index.asp") to absolute links (i.e.
"http://localhost/index.asp") when I set the iframe's innerHTML.
This is bad as the links are supposed to be relative. How can I avoid
this? Any solutions/suggestions are much appreciated.
- This (setting the innerHTML) works just fine in Mozilla/Netscape.
- I have tried to create a selection/range and use "pasteHTML" instead
but the result is the same.
- I have tried to set the "html head base href" in the initial
document loaded by the iframe but the result is the same.
Example:
myiframe.contentWindow.document.body.innerHTML = '<a
href="/index.asp">xxx</a>';
alert(myiframe.contentWindow.document.body.innerHTML);
Output:
<a href="http://localhost/index.asp">xxx</a>