DHTML Lab - dhtmlab.com - Dynamic Headline Fader, Version 2.01 | 8 | WebReference

DHTML Lab - dhtmlab.com - Dynamic Headline Fader, Version 2.01 | 8

Logo

Dynamic Headline Fader, Version 2.01
accounting for expected syntax in IE4mac


The Problem

An error message, similar to the one below, appears when loading a page that contains the fader:

The Line and Char fields do not lead us to the statement that generated the error. Now, why doesn't that surprise me? There is no line 481 and once we do identify the correct statement, manually, the error is not on character 2!

The statement-in-question is this line from Version 2.0, which we inserted to hasten initial page display in IE:

setTimeout("initIt()");

In Column 25, we described the reason for this statement, and its syntax, in this way:

Explorer stops to refresh the display only if it is idle. While a script is executing, no refresh is possible. Many users complain about pages that use onload handlers to run complicated scripts. In many cases, they don't see the page until the script has finished executing, especially if the page contains tables. We therefore provide an idle time for Explorer, the smallest possible actually, by using a setTimeout() without a time interval argument. Explorer will now display the page then execute initIt().

The no time interval argument trick will not work in IE4mac. The second argument for setTimeout() is mandatory.

The Solution

We simply include the argument using a very small interval. For example, one millisecond:

function FDRcountLoads() {
   if (IE4) {
      setTimeout("FDRinit()",1);
   }
   else {
      .
      .
      .
   }
}

There are still a couple more problems to solve for IE Macintosh.


Produced by Peter Belesis and

All Rights Reserved. Legal Notices.
Created: Sep 21, 1999
Revised: Sep 21, 1999

URL: http://www.webreference.com/dhtml/column25/addendum1/fdr201iemac.html