PDA

View Full Version : Resolved Text and Image Crawler aborting operation in IE



msaz87
05-07-2009, 01:20 AM
1) Script Title: Text and Image Crawler

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/crawler/index.htm

3) Describe problem: IE aborts page load... all other browsers work fine

Big fan of the script... and I'm using it as a sort of scoreboard like espn.com or other sites, and while it works great in most browsers, IE aborts the operation and fails to load the page.

I have it broken down into a few parts...

- A structure file (structure.php) that includes the javascript and general formatting

- A day file (mon.php, sat.php, etc.) that includes a php function that generates the tables within the div to scroll

The structure file is included in all of the day files and works great in Firefox, Safari and Chrome.

Here's a look at the structure file:

<head>
<script type="text/javascript" src="../js/scripts.js">
/*
Text and/or Image Crawler Script 2009 John Davenport Scheuer
as first seen in http://www.dynamicdrive.com/forums/ username: jscheuer1
This Notice Must Remain for Legal Use
*/
</script>
</head>
<body background="../images/backgrounds/scoreboard_gradient.gif" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<div id="rotate">
<font color="#00000" size="1" face="arial">
<table id="enclosure" valign="top">
<td align="left" valign="bottom">
<table width="70">
<font size="2" color="#003366"><b>

<? echo $day; ?>

<br/></font>
<font size="3" color="#003366">

<? echo $week; ?>

</b></font>
</table>

<? echo $tables; ?>

</td>
</tr>
</table>
<br/>
<br/>
</div>


<script type="text/javascript">
marqueeInit({
uniqueid: 'rotate',
style: {
'padding': '0px',
'width': '413px',
'height': '60px'
},
inc: 5, //speed - pixel increment for each iteration of this marquee's movement
mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
moveatleast: 2,
neutral: 150,
savedirection: true
});
</script>


Here's the code that sets up the tables...

$tables.= '<td><table id="'. key($content). '" width="130" bgcolor="#F2F2F2" cellpadding="0" border="2" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#000000" border-style="solid"><tr>';

next($content);

for ($e = 0;$e < $numberofscores-2; $e++) {

$tables.=
'<td><font size="2">' .$content[$c][$e] . '</td>';
}

$tables.='</tr><tr>';

for ($e = 2; $e < $numberofscores; $e++){

$tables.= '<td><font size="2">' . $content[$c][$e] . '</td>';

}

$tables.='</tr></table></td>&nbsp;';

}

And a link to the page it's failing on:
http://www.fasports.com/az/phx/scores/mon.php

Thanks in advance for any help!

jscheuer1
05-07-2009, 06:15 PM
Generally that means that the HTML is invalid. IE will abort page load if it thinks the script is trying to write to a table that hasn't been properly closed. Or if there are other markup issues the script may run, but it's content may not be visible.

The latter appears to be the case, as IE developer toolbar sees (in addition to what I suppose is supposed to be there) an element with no tag name in your markup within the crawler. This element contains an orphan td tag.

In any case, it is best to use valid markup.

msaz87
05-07-2009, 09:10 PM
Just to try and make sure I understand what you meant...

The cause is likely because there's a <td> without a corresponding </td>? Or something of that sort?

Basically if I can figure out the error in the php that's outputting the table, I should be able to get it to work in IE?

I was worried that the setup I had was just not going to want to work in IE...

Thanks for the help!

msaz87
05-08-2009, 12:11 AM
I was able to get it working... just had to go through and re-code the portions that built the tables and eventually I figured it out.

Thanks for your help!