to js wait.... setTimeout("functionCall()",1000);

-----Original Message-----
From: Ian Skinner [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2003 8:47 AM
To: CF-Talk
Subject: OT: Making _javascript_ Wait.

I have a page that has upwards of 200 links on it that each will open a
detail screen in a new window with a _javascript_ function.  This is a
calendar display showing all the events in a month with the ability to get
further details in a popup window by clicking on the event's name.

The problem, is that apparently the _javascript_ throws an "object expected"
error, if a link is clicked before the entire calendar page is rendered.  It
is large enough, the this can take a full second or three to complete.  

Is it possible to prevent this error?  A better way to implement the code so
that it doesn't matter if the main window if fully rendered? Something to
cause the function to gracefully fail (no error message displayed) or not
run or wait if it's not ready to run correctly?  Something else?

Thanks for any help.

function Popup(file,width,height)
{

var topX = (screen.width - width)/2;
var topY = (screen.height - height)/2;

popup = window.open(file, "Popup", "fullscreen=no, toolbar=no,
status=no, menubar=no, scrollbars=yes, resizable=yes, directories=no,
location=no, width="+width+", height="+height+", left="+topX+", top="+topY)
popup.focus();

return false;
}

--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message.
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to