You are not logged in.
IE 6 and IE 7, seems to have issues with timing.
We have a xinhaInit() function which we have to delay calling about 2500ms, otherwise the focus in the editor doesn't happen.
Our problem is that there are other widget using javascript on the same page.
The IE script debugger seems unsuable to track this kind of issue which seems to relate to improper events handling.
What would be your recommanded way to debug this issue.
I would like to know if there is a way, to test programatically that the ixnha editor is ready to be initialized.
I tried to do that in below code snippet, but that's not sufficiant.
notes :
- we are working with revision 421, but could reproduce same behaviour when replacing with Xinha nightly build of 2007/06/11
- the delay being introduce is the result of trials cycles on that particular client machine (other client machines may be faster, don't necessarily exhibit the problem).
Our code looks like this :
....
<script type="text/javascript" src="/xinha/htmlarea.js"></script>
<script type="text/javascript">
<!--
function xinha_init() {
var Xplugins = [ ];
if(!HTMLArea.loadPlugins(Xplugins, xinha_init)) return;
var Xeditors_list = ['mytext'];
var Xconfig = new HTMLArea.Config();
Xconfig.toolbar = [ [
"bold","italic","underline","strikethrough","insertorderedlist",
"insertunorderedlist","outdent","indent","justifyleft","justifycenter",
"justifyright","justifyfull","copy","cut","paste","undo","redo"
] ];
var Xeditors = HTMLArea.makeEditors(Xeditors_list, Xconfig, Xplugins);
HTMLArea.startEditors(Xeditors);
}
if(typeof xinha_init == "function" && typeof HTMLArea.init == "function") {
if (HTMLArea.is_ie) {
setTimeout("xinha_init()",2500);
} else {
xinha_init();
}
....
Last edited by pitonew (2007-06-21 05:08:24)
Offline
yes, i don't control directly the whole page, and don't want to overwrite window.onload.
Offline
You should consider the method proposed in the NewbieGuide
Xinha._addEvent(window,'load', xinha_init); // this executes the xinha_init function on page load
// and does not interfere with window.onload properties set by other scripts
(Of course you have to use HTMLArea._addEvent() in 421)
Offline
thanks, that Xinha._addEvent(window,'load',xinha_init); did it.
Offline