Rapid JS timer (setTimeout()) hides HTML hints

L

Lester

I need to fire a function 4 times a second using setTimeout()), but I
have an HTML-editor on the page (FCKeditor) which has hints over its
buttons. However, the rapid timer never allows these hints to appear.
Commenting out setTimeout() solves everything, hints come back.

How can I save these hints from disappearing (before even appearing)
when setTimeout fires?

Many thanks,
Keke
 
R

RobG

Lester said:
I need to fire a function 4 times a second using setTimeout()), but I
have an HTML-editor on the page (FCKeditor) which has hints over its
buttons. However, the rapid timer never allows these hints to appear.
Commenting out setTimeout() solves everything, hints come back.

How can I save these hints from disappearing (before even appearing)
when setTimeout fires?

Whithout an example of whatever it is that you are doing, the only help
you'll get are guesses.

It is possible that either you have a naming conflict or that your
repeated calls to setTimeout are hogging the one and only thread that
JavaScript has available to it, preventing anything else from
happening.

Post either a minimal example or a link to a page that displays the
behaviour. Quite often the process of making a minimal example will
make the cause apparent.
 
K

Keke

Okay. It's an ASP page.

<%
Dim oFCKeditor ' FOR FCKEDITOR, SEE www.fckeditor.net
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "/Fforumeditor/"
oFCKeditor.Width = 513
oFCKeditor.Create "message"
%>

.....

<SCRIPT language="JavaScript">
<!--
var timeoutobject;
var oEditor;
var temporaryvalue = '';

function FCKeditor_OnComplete( editorInstance )
{
oEditor = editorInstance; //here we store the editor instance for
later use
timeoutobject = setTimeout("timing()",270);
}

function timing()
{
mymaxlength=2500;
t=oEditor.GetXHTML(true);

if (t.length > mymaxlength) {
//message too long, warning + set revious state
if (t.length > mymaxlength) {
oEditor.SetHTML(temporaryvalue);
alert('Message max length is ' + mymaxlength + ' characters.');
}

} else {
temporaryvalue = t; //set current message, we may need it later
document.frm.qwertyuiop.value = mymaxlength - t.length; //text field,
shows character count
}
timeoutobject = setTimeout("timing()",270);
}
//-->
</SCRIPT>
 
R

RobG

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

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top