[techexplorer-support] programming related question
Aleksey
news4al at freemail.ru
Wed Jul 6 10:22:48 MDT 2005
Hello Sam,
Thanks for your reply!
Wednesday, July 6, 2005, 5:13:35 PM, you wrote:
[skipped]
SD> You may call the recomposeAndRedraw method from the TEDocument interface:
SD> techexplorer techexpl = ... reference to the plugin or ActiveX control object ...
SD> techexpl.getDocumentNode().recomposeAndRedraw();
But I don't know how I can get this interface. I use techexplorer as an
Internet Explorer MathML Behavior. Here is the tiny sample:
------------------------------------------------------------------------
<head>
<object name="mml" classid="clsid:0E76D59A-C088-11D4-9920-002035EFB1A4"></object>
<?import namespace="m" implementation="#mml" ?>
<title>Integre Techexplorer Testbed</title>
<script language="JavaScript" type="text/javascript">
function handleClick()
{
var a = document.getElementById("a");
var b = document.getElementById("b");
var p = a.parentNode;
p.insertBefore(a, b);
p.insertBefore(b, p.firstChild);
// I tried
document.all.mml.getDocumentNode().recomposeAndRedraw();
// but an error was raised:
// "Object doesn't support this property or method"
}
</script>
</head>
<body>
<h2>Scripting</h2>
<div>
<m:math>
<m:mrow>
<m:mo>(</m:mo>
<m:mi id="a">a</m:mi>
<m:mo>+</m:mo>
<m:mi id="b">b</m:mi>
<m:mo>)</m:mo>
</m:mrow>
</m:math>
</div>
<p><form>
<input type="button" value="Swap a and b" onClick="handleClick()">
</form></p>
</body>
</html>
------------------------------------------------------------------------
You can create test.htm file, copy the code there and open the file in IE.
I use Internet Explorer version 6.0.2900.2180_xp_sp2_gdr.050301-1519
I guess that recomposeAndRedraw() doesn't word in IE Behavior mode.
Correct?
BTW, when I call
p.insertBefore(a, null);
I get error: "Overflow" But null is legal argument. The DOM Reference
state:
-----------
Node insertBefore(Node newChild, Node refChild) throws DOMException;
newChild
The node to be inserted into the tree. If it is a DocumentFragment,
its children are inserted instead.
refChild
The child of this node before which newChild is to be inserted. If this
argument is null, newChild is inserted as the last child of this node.
-----------
--
Best regards,
Aleksey mailto:news4al at freemail.ru
More information about the techexplorer-support
mailing list