Design Mode implementation, misc problems

A

AaronNGray

Hi,

I have created a minimized DesignMode test, that works accross all the
main browsers AFAICT and on IE5, 6, 7, and 8.

I have two problems on IE :-

- the first is IE insists on putting a borderframe on the iframe
window, even though I have fameborder set to "no".

- second, is focus, IE does not give the iframe focus until the mouse
cursor goes over the window.

Here's my code :-

http://www.aarongray.org/comp.lang.javascript/DesignMode/Edit.html

~~~~
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script>

window.onload = Init;

function Init() {
var f = document.createElement("iframe");
f.id = "editableiframe";
f.className = "editable";
f.style.border = "solid 1px black"
f.frameborder = "no";
f.setAttribute("frameborder", "no");

document.body.appendChild(f);

f.contentWindow.document.open();
f.contentWindow.document.write("<html><body>tester</body></html>");
f.contentWindow.document.close();

f.contentWindow.document.designMode = "on";

f.contentWindow.focus();
}

</script>
</head>
<body>
</body>
</html>
~~~~

Many thanks in advance,

Aaron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top