473,396 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Rapid JS timer (setTimeout()) hides HTML hints

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

Sep 10 '06 #1
4 4365

Lester wrote:
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.
--
Rob

Sep 10 '06 #2
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>

Sep 12 '06 #3
http://fidelio.hu/forumhozzaszolas.a...asp%3Fid%3D346

Here is a LIVE (!) page with the code above. Please be careful with
posting test example messagges there, because it is PUBLIC :-)

The editor buttons never show the hints, because of the timer. (They DO
have hints.)

Sep 12 '06 #4

Keke wrote:
http://fidelio.hu/forumhozzaszolas.a...asp%3Fid%3D346

Here is a LIVE (!) page with the code above. Please be careful with
posting test example messagges there, because it is PUBLIC :-)

The editor buttons never show the hints, because of the timer. (They DO
have hints.)
Get rid of setTimeout completely. The function seems to be called just
to count the remaining number of characters, why not use onkeypress or
onkeyup?

--
Rob

Sep 12 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
by: Mic | last post by:
Goal: delay execution of form submit Code (Javascript + JScript ASP): <% Response.Write("<OBJECT ID='IntraLaunch' STYLE='display : none' WIDTH=0 HEIGHT=0...
1
by: Antoine | last post by:
Hello, Does anybody know a way to retreive the running timers (their ids) in a html page? I cannot find something in the html dom at first sight. Is there collection of timers available (like...
2
by: Athanasius | last post by:
Could someone shed some light as to why the following setTimeout function will not work on the Mac IE5.2? It does however work on PC(Forefox,Netscape,IE) & Mac(Safari,Firefox). Here is the script,...
2
by: JellyON | last post by:
Hi. I'm a little bit lost trying to insert a setTimeout() for recursive call containing string and numeric parameters. Here is a generic example of what I would like to succeed to do : ...
6
by: Brent | last post by:
Is there any obvious reason why there's no delay in the execution of setting the id.style.display when this function gets called? function Hide(divId,timeout) { var id =...
15
by: nikki_herring | last post by:
I am using setTimeout( ) to continuously call a function that randomly rotates/displays 2 images on a page. The part I need help with is the second image should rotate 3 seconds after the first...
0
by: hzq3554055 | last post by:
i am novice,guess the following code can work combineing with server- side code ,but chaos ï¼›somewhere to me is great<script> var relationObject = {timer: null, key: ""}; function...
3
JamieHowarth0
by: JamieHowarth0 | last post by:
Hi folks, I have a bit of a headache. I've finally added all the nice finishing touches to my own website (static only with a bit of DHTML). Now I've just converted the whole thing to AJAX with a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.