...

View Full Version : PERFECTION with Firefox, script errors with IE6 and IE8



nibelungen
08-29-2009, 09:17 AM
Hello everyone.
I'm new to this forum and very inexperienced when it comes to javascripting, so please have mercy if I display too much ignorance for those experienced gurus. Thanks. Anyway, I'm trying to help someone out with a script that they'd like to implement on pages in their website. We found a script that does the job perfectly and it's actually supposed to be cross-browser compatible. The script is from 2003 or 2004 though. There are 4 additional js files that work together with the script that's embedded in the html files. Here's a link to a page with that script:

This script works 100% perfectly with Firefox (http://www.einfachclicken.de/banners/bannermuster02.html)

However, when I try to check that same page with IE6 (can't check with IE7/8 since I'm using Ubuntu), I receive a script error on the bottom, telling me that the error is on line 55, character 7. With IE6 the page shows the background cell, but not the contents that the script is supposed to produce. Checking the html file doesn't tell me anything at all since that line needs to be there. A friend of mine who has a little javascript knowledge used a javascript debugger. He told me that when he tries to view the page with IE7 or IE8 he gets that bar at the top about activating unsecure (javascript) elements on the page? According to him, the javascript debugger mentions that an error is coming out of the separate dw_core.js file.

The script debugger showed the error in this section of the dw_core.js file:

dynObj.prototype.writeLyr = function (cntnt) {
if (typeof this.doc.innerHTML!="undefined") {
this.doc.innerHTML = cntnt;
} else if (document.layers) {
this.doc.write(cntnt);
this.doc.close();
}
}

Specifically this line is where the error is supposed to be coming from:

this.doc.innerHTML = cntnt;

So he told me to change the if line to this instead:

if (typeof this.doc.innerHTML!="undefined" && typeof this.doc.innerHTML!=null)

That didn't help though. :(

We did try using the full path to the js files and we also tried placing the js files in the same folder as the html files. Placing the script tags to the js files out of the <HEAD> section actually made the script work smoother for some weird reason.

There's an alternative script that's being used at the moment (same link as above, but without the 02 at the end) however that one won't display the title text for links/images when viewed in Ubuntu/Firefox. Other than that it works great with IE6/7/8 and Firefox. The script that we'd like to use (link above) is much more attractive with its effects though and the title text does indeed show up in all of the browsers. I'd really appreciate some help on this and would be willing to make a little Paypal donation for the (successful) effort if we can get it all to work right with Ubuntu/Firefox. Thanks a bunch for your time and patience in advance.

Greetings from Germany

Dimitar
08-29-2009, 03:20 PM
erm, first off - what do you expect from such an old script.

the IE problem is something else though--it's a problem when you write into innerHTML for IE like so as it messes up it's snapshot of what the DOM contains.

google the error like so for clues:

IE javascript unknown runtime error innerHTML

in my experience, duplicate element ids (such as ones being inserted in the innerHTML), unclosed tags or bad tags can cause this. oh, and DOM that's not ready. also, you will notice that it typically messes up the second time you do this and works on the first one. this is probably due to IE still evaluating what dom changes have taken place when you feed it the second one... particularly true if you have any events bound to the elements you're modifying, it panics as the garbage collector cannot determine what to make out of it and in order to leaks etc, it stops. anyway, good luck

ps. who told you it works for firefox? :D 3.5 here on vista and
dynObj is not defined
http://www.einfachclicken.de/banners/bannermuster02.html
Line 31

so, likely a syntax error somewhere, a runaway " or ' may be causing it to throw an exception...

nibelungen
08-29-2009, 04:06 PM
erm, first off - what do you expect from such an old script.

ps. who told you it works for firefox? :D 3.5 here on vista and
dynObj is not defined
http://www.einfachclicken.de/banners/bannermuster02.html
Line 31

Thanks a lot. Well, obviously we expect for the script to work. It worked on the test page where we found it, some big javascript site.

From what you're saying, the problem may be worse than we thought since the script really does work perfectly on our linux/Ubuntu version of Firefox, version 3.0.13. It's doing everything that it is supposed to do ... dropping 5 banners one at a time with a very attractive "eye pleasing" scroll down effect, while retracting each banner after 5 seconds with a much quicker, still attractive scroll up effect.

The script is supposed to be for a very user friendly, family friendly, entertaining, and largely child safe site. Because of this the owners want to implement banners somewhat "restrictively" to keep in line with the user friendly aspect of the whole thing. This particular script fit that goal (or so we thought anyway). :(

Greetings from Germany

Dimitar
08-29-2009, 06:00 PM
for your requirements, you can get a small install of a framework like mootools or jquery with the right plugin, it's not hard to do at all

i just wrote this from scratch in 35 mins with mootools, it can be tweaked a lot to stop animations on mouseover etc.... i bet there are plugins for it, and i bet there are plugins for jquery as well.

http://fragged.org/dev/banners.php

good luck :)

nibelungen
08-29-2009, 06:56 PM
i just wrote this from scratch in 35 mins with mootools, it can be tweaked a lot to stop animations on mouseover etc.... i bet there are plugins for it, and i bet there are plugins for jquery as well.

http://fragged.org/dev/banners.php

Thanks again, but like I said in the very beginning ... I'm very inexperienced, so even that is already too much for me since I'm too busy with other projects (work, family, dogs) to be learning something completely new that I've never dealt with before. I did check out the site though, pretty cool stuff, especially that opacity effect. That's slick ...
Problem with the accordeon plugin is that it requires additional top/bottom space which won't work on the pages that we're trxing to implement the script on.

I'll probably just tell my friends to go ahead and either stick with their backup script, or to go ahead and buy a finished commercial script with included setup instructions. I found 3 scripts for them online, ranging in price from 5.00 $ to 12.50 $ and I'm sure that one of them will work. They're more recent too, like from 2007/2008 and have been tested with FF, Opera, and IE7.

I'll keep an eye on this post for another day or two, to see if anyone else has some suggestions. If not, then I'll tell my friends about those other options that I found. Thanks a bunch for your time and patience though, it's appreciated.

Greetings from Germany



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum