Script "kills" the rest of page in IE, not in Firefox

C

Cloy

I'm currently working on a revised home page for my church.

The script loads a date listing into an iframe (in a table cell) at
the right side of the page and then scrolls the list to today's date.
The script works okay on all version of Firefox and IE for Macintosh.

On IE for Windows, the script seems to runs okay, but none of the
content below the script appears on the page. Below is the script.

THe page address is http://www.pontonline.org/index-new3.htm

Thanks, in advance, for any suggestions on this.

Excelsior! -Cloy


<script language="JavaScript">
<!--
var date = new Date();
var d = date.getDate();
var day = (d < 10) ? '0' + d : d;
var m = date.getMonth() + 1;
var month = (m < 10) ? '0' + m : m;
var year = date.getFullYear();
document.write('<iframe name="News" width="280" marginwidth="0"
height="280" frameborder="0" marginheight="0" align="left"
scrolling="auto" hspace="0" vspace="0" src="office/calendar-
items.htm#' + month + day + year + '"');
document.write('Your browser does not support inline frames or is
currently configured not to display inline frames.')
document.write('</iframe>')
// -->
</script>
 
C

Craig Taylor

I'm currently working on a revised home page for my church.

The script loads a date listing into an iframe (in a table cell) at
the right side of the page and then scrolls the list to today's date.
The script works okay on all version of Firefox and IE for Macintosh.

On IE for Windows, the script seems to runs okay, but none of the
content below the script appears on the page. Below is the script.

THe page address ishttp://www.pontonline.org/index-new3.htm

Thanks, in advance, for any suggestions on this.

Excelsior! -Cloy

<script language="JavaScript">
<!--
var date = new Date();
var d = date.getDate();
var day = (d < 10) ? '0' + d : d;
var m = date.getMonth() + 1;
var month = (m < 10) ? '0' + m : m;
var year = date.getFullYear();
document.write('<iframe name="News" width="280" marginwidth="0"
height="280" frameborder="0" marginheight="0" align="left"
scrolling="auto" hspace="0" vspace="0" src="office/calendar-
items.htm#' + month + day + year + '"');
document.write('Your browser does not support inline frames or is
currently configured not to display inline frames.')
document.write('</iframe>')
// -->
</script>

I see where the <iframe is started but where does the actual iframe
tag end eg:
<iframe name= src="blah" but no ending '>'

I checked your link to see if this might have been a mistake in
pasting... it doesn't appear so.

It's always the small stuff.

- Craig Taylor
www.ctalkobt.net
 
R

RobG

I'm currently working on a revised home page for my church.

The script loads a date listing into an iframe (in a table cell) at
the right side of the page and then scrolls the list to today's date.
The script works okay on all version of Firefox and IE for Macintosh.

On IE for Windows, the script seems to runs okay, but none of the
content below the script appears on the page. Below is the script.

THe page address ishttp://www.pontonline.org/index-new3.htm

Thanks, in advance, for any suggestions on this.

Excelsior! -Cloy

<script language="JavaScript">

The language attribute is deprecated, type is required. Replace with:


There is no need for HTML comment delimiters, just remove them.

var date = new Date();
var d = date.getDate();
var day = (d < 10) ? '0' + d : d;
var m = date.getMonth() + 1;
var month = (m < 10) ? '0' + m : m;
var year = date.getFullYear();
document.write('<iframe name="News" width="280" marginwidth="0"
height="280" frameborder="0" marginheight="0" align="left"
scrolling="auto" hspace="0" vspace="0" src="office/calendar-
items.htm#' + month + day + year + '"');

Craig may be onto something - the opening iFrame tag seems to be
missing he closing ">", see below.

document.write('Your browser does not support inline frames or is
currently configured not to display inline frames.')
document.write('</iframe>')
// -->

Remove this comment delimiter too.
</script>

It is best to write the entire iframe in one string rather than three
separate strings - browsers are more likely to correctly handle
complete elements than ones added bit by bit.

e.g.:

var HTMLstring = '<iframe name="News" width="280" marginwidth="0"' +
' height="280" frameborder="0" marginheight="0" align="left"' +
' scrolling="auto" hspace="0" vspace="0"' +
' src="office/calendar-items.htm#' + month + day + year + '">' +
'Your browser does not support inline frames or is' +
' currently configured not to display inline frames.</iframe>';
document.write(HTMLstring);
 
C

Cloy

Thanks for the help, gentlemen!

The missing > fixed the error and I modified the script tag as Rob
suggested.

One other quick question if you have time....

The script I use to scroll the iframe content to the proper place also
makes the page "jump" down after it loads.

Any suggestions on a workaround for this? Is there a command I could
use to onLoad(scroll-to-top) or something like that?

Excelsior! -Cloy
 

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
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top