View Full Version : Text and Image Crawler

04-21-2009, 01:54 AM
Hey John. Love the script and am integrating it with settings that can be changed from within my vbulletin admincp.

Demo (http://www.glorifythepast.com/forums/index.php)

Anyway, I am getting RANDOM errors in IE 7. I call the script after the table. Strange because they are intermittent with so many page loads. Wonder if you can shed some light on it.

My code is yours modified with vb variables as you'll see. Any ideas?

<!-- GTP Marquee System -->
<if condition="$vboptions[gtp_marquee_system_switch]">
<table cellpadding="0" cellspacing="0" border="0" width="943px" align="center">
<if condition="$vboptions['gtp_marquee_system_image'] == ''">
<td class="alt1" width="10%"><div class="smallfont" align="center"><b>Latest News:</b></div>
<td class="alt1" width="90%">
<else />
<td class="alt1" width="83px"><div align="center"><img src="{$vboptions['gtp_marquee_system_image']}" /></div>
<td class="alt1">
<div class="marquee" id="mycrawler">
<if condition="$vboptions['gtp_marquee_system_message'] == ''">
...If you want your message to use different/multiple font colors for different styles, please edit your message here per style and leave your admincp message setting blank...
<else />

<div style="padding:0 0 2px 0;"></div>

<script type="text/javascript">
uniqueid: 'mycrawler',
style: {
'color': '#ffcc00', // Font color customize IF NEEDED per style
'width': '{$vboptions['gtp_marquee_system_width']}',
'font-family': '{$vboptions['gtp_marquee_system_font']}',
'font-size': '{$vboptions['gtp_marquee_system_size']}px',
'padding': '{$vboptions['gtp_marquee_system_padding']}px'

inc: <if condition="$vboptions['gtp_marquee_system_behavior'] == 'cursor driven'">8<else />'{$vboptions['gtp_marquee_system_speed']}'</if>,
mouse: '{$vboptions['gtp_marquee_system_behavior']}',
moveatleast: '{$vboptions['gtp_marquee_system_speed']}',
noAddedSpace: <if condition="$vboptions['gtp_marquee_system_addedspace']">false<else />true</if>,
neutral: {$vboptions['gtp_marquee_system_neutral']},
savedirection: <if condition="$vboptions['gtp_marquee_system_direction'] == 'true' OR $vboptions['gtp_marquee_system_direction'] == 'false'">{$vboptions['gtp_marquee_system_direction']}<else />'{$vboptions['gtp_marquee_system_direction']}'</if>
<!-- / #End GTP Marquee System -->

04-21-2009, 05:50 AM
Well, I don't know much about vb. But the code used must generate code that the browser can interpret. IE 7 is one of the more finicky browsers when in comes to how the HTML and script code must be written. Your best bet would be to catch it misbehaving, and then use the browser's 'view source' to see the script and HTML code being served. Then the error may be a bit more obvious. You can then work backward from there to how it was generated.

However, with so much going on with the page, it may be a conflict with another script, or perhaps even a problem with another script entirely.

IE is not the best when it comes to reporting errors either, but at least it does say what it thinks is the problem. Armed with whatever error it does give, and the served source code, it should be fairly easy to at least narrow down what the problem is.

04-21-2009, 11:11 AM
Thanks. The error I get is:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506)
Timestamp: Tue, 21 Apr 2009 11:04:42 UTC

Message: Object doesn't support this property or method
Line: 1
Char: 1
Code: 0
URI: http://www.glorifythepast.com/

Message: Object doesn't support this property or method
Line: 1
Char: 1
Code: 0
URI: http://www.glorifythepast.com/

And this is the page source for line 1:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

And the source looks the same with no errors. When I disable the crawl, there are no errors on multiple refresh. I may not eben worry about it if it's only an IE 7 issue. I'll test in 8. Works fine in Chrome, Opera, and Firefox.

04-21-2009, 01:18 PM
Looks like that error was from IE 8.

I did say may, and that IE error reporting isn't the best. We get some information though. That looks like an onload error (line 1 often refers to script generated events like onload, or onclick).

But that line 1 from the served source isn't telling us anything. I'd need to see the marquee division and any container elements and the generated marqueeInit.

In any case, I've just been playing around with the page in IE 7 a bit more and it seems that the only way I can generate the error is during page load. And I have to be quick in clicking on the little yellow triangle because once the page actually loads, the error goes away and the marquee runs. And it seems that the page signals load completion before it is actually loaded. This may point to a problem with other scripts or to the fact that there is some sort of lag in the server side substitutions that is confusing the browser.

This second theory may be tested by removing all server side substitutions from the page, even ones not involving the script. If the error will not repeat at that point then it is something to do with those subs.

But as long as the error goes away after page load and the marquee works (like is happening here), I'd count that as lucky and not worry about it.

The only thing I can think of at the moment to try - from the script point of view, is to take the marquee out of the table. Initialization in IE happens differently then.