PDA

View Full Version : stayontop.js: Div immediately disappears in IE



hblieb
06-28-2010, 06:40 PM
1) Script Title: stayontop.js

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/stayontop.htm

3) Describe problem: Either way I call it (internal or external), it doesn't work in IE8 (haven't tested IE7 or IE6). Works fine in FF3 and Safari.

The div appears, then disappears immediately. The browser says there are errors on the page. Line 47 char 3 of stayontop.js, object doesn't support this property or method.

Any ideas? You can see the problem, for now, at http://bit.ly/cUnkTf

jscheuer1
06-28-2010, 07:19 PM
You haven't really followed the instructions. I think you were trying to, but the way you did it resulted in opposite of the required effect in IE. Some other browsers are less finicky. Anyways, where you have (at the very top of your page's source code):


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>

<head>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

It should be:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>