PDA

View Full Version : Internet Explorer letting me down



jol
12-30-2009, 07:15 PM
Hi there - I was wondering if anyone out there could help me

I'm redoing my site from many years ago - www.industrialarts.co.uk

It contains a "Conveyor" - to which I've always wanted to add a "Lightbox" effect.

Well - the good news is that I've managed to get a test page up and running and it's doing exactly what I want it to in Firefox, Chrome, Opera and in Safari

However .. in Internet Explorer 8 .. it ain't good. The scripts on the page seem not to work at all. (In Internet Explorer 7, it's worse as the formatting is haywire too - but I'll try to fix one thing at a time)

http://www.industrialarts.co.uk/test/chairs/chairs.html

So - if anybody could be good enough to take a look at my test page and offer any suggestions for getting it running on Internet Explorer too .. or just where to look for answers - I'd be massively grateful

My apologies also as I'm a dabbler with this stuff (normally a woodworker)

Cheers, Jol

tomws
12-30-2009, 07:57 PM
You have a load of validation errors (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.industrialarts.co.uk%2Ftest%2Fchairs%2Fchairs.html&charset=%28detect+automatically%29&doctype=Inline&group=0). Removing the duplicate doctypes, html tags, and body tags would go a long way toward reducing that number.

arthurakay
12-30-2009, 08:10 PM
First of all, I suggest you find a debugger for IE which will help you pinpoint these kinds of errors.

The problem is that you have a JavaScript error. IE is particular about JS errors... meaning things just stop working, whereas other browsers (like Firefox) try to execute as much of the code as they can. IE just kills the method which contains the error.

According to my IE debugger (CompanionJS), there's an "Invalid property value" at line 51 in "imagemotion.js".

Firebug (in Firefox) also hits a JS error, but it's at line 70 (same file). Firebug complains that "document.getElementById(slide.id) is null".

So... what's the problem? IE and Firefox often complain about different errors, even though (sometimes) it is in fact the same error. Strange, but that's life.

From what I can tell, your script attempts (at some point) to locate a DOM element with the ID "slider_2"... which doesn't exist.

In the case of your website, this doesn't effect Firefox because it continues attempting to render "slider_1". IE on the other hand completely gives up, killing the rest of the rendering process.

The solution: give your page the "slider_2" element it is looking for, or make your script stop looking for that element. I don't know what you're trying to do with it, but my guess is that you don't need the "slider_2" element.

jol
12-31-2009, 03:03 PM
That's brilliant !!

.. many many thanks !

I'm a tinkerer and I think that must be frustrating for the experienced folk

Either way - really !! do !! appreciate your assistance !!

I'll get my head around your comments .. and report back

Seems you're quite right about Slider2 .. it's an option in the script and it's definately not needed

Again - thanks for your help - I'll press on and report my progress here !

Cheers !

Kind Regards and a very Happy New Year to all !

PS. Test page is now at http://www.industrialarts.co.uk/chairs/chairs.html

jol
01-06-2010, 08:22 PM
Hi again !

I'm pleased to report that I've made some really good progress since last week

I've managed to get the error count down very significantly

However - I am still showing errors - and DOCTYPE appears to be a common theme. Most Browsers are showing really well - but I just can't get past problems with Internet Explorer !

Yes, I can see there is also a problem with Slider_2 which I dont want to use at all - I'm told that omitting the comma at the end of Slider_1 will deactivate slider_2 etc .. but from what I can see - this does not work !

So - in summary - I feel I'm making good progress - but I still fail completely with Internet Explorer and I'm hoping for some more tips to help me edge forward with this project

Many thanks if you can offer any further advice

Kind Regards, Jol

jol
01-06-2010, 08:42 PM
Sorry - forgot to say - the site is now live at this address : www.industrialarts.co.uk

tomws
01-06-2010, 08:47 PM
The validator says your doctype is incorrect. Replace it with this:

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

The other errors are related to the Flash, I think.

drhowarddrfine
01-06-2010, 08:47 PM
However - I am still showing errors - and DOCTYPE appears to be a common theme.Because you're using the wrong one. Use this one:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

You should be using a strict doctype, too, but since you're updating an old site with one of those auto-generator programs, I guess it can't be helped.

Now revalidate with the proper doctype.

Most Browsers are showing really well - but I just can't get past problems with Internet Explorer !None of us ever will.

KevinJohnson
01-07-2010, 12:38 PM
Sorry - forgot to say - the site is now live at this address : www.industrialarts.co.uk

you could have an OnLoad="DetectBrowser();" function, and if it detects IE you could ask them to install an alternative functional browser - LOL
but that would be lazy, wouldn't it ?

^_^

hehe

jol
01-07-2010, 07:28 PM
Kev - I already thought of that : )

DRHoward & Tom - many thanks ! ... I changed the DOCTYPE and now have less errors

I fixed a couple of silly errors too - and now some of the simpler pages have zero errors !!

However ... it's still not working at all in IE 8, although looking much better in all other browsers.

I really appreciate the help you guys have given me pushing this forward - If anyone feels they can offer any other gems - it would be very gratefully received !!

Once again the address is www.industrialarts.co.uk

Cheers, Jol

tomws
01-07-2010, 07:36 PM
That little yellow triangle down in the lower left corner of IE8 means there's a js error. Here are both:

Message: Invalid property value.
Line: 51
Char: 2
Code: 0
URI: http://www.industrialarts.co.uk/js/imagemotion.js


Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
Line: 0
Char: 0
Code: 0
URI: http://www.industrialarts.co.uk/


The second may be a result of the first. My js debugging in IE isn't very good, so I don't think I can help much.

jol
01-07-2010, 08:10 PM
Thanks Tom .. I'm way out of my depth already .. but things look just fine in all the other browsers - so I feel it must be do-able.

Maybe I need to pay a guru to get me past this

All advice gratefully received !

bazz
01-07-2010, 09:33 PM
Sorry, can't help because the page doesn't open at all in IE6.

Check out the status bar area to see what its tripping over.
bazz

jol
01-08-2010, 12:16 AM
Thanks Bazz ! - but the status bar is in Greek - or may as well be : )

I'm getting exactly what I want in all browsers except IE

IE8 is better than IE 6 & 7 .. in that the formatting is close to correct - but all versions of IE seem to trip over with the Javascript

Not sure where I go next as I am already way out of my depth - so any and all suggestions are greatly appreciated !

Jol

Old Pedant
01-08-2010, 01:19 AM
Well, clearly the error is on or about line 51 in the js file.

I *suspect* it may be here:

this.mousereact.style.backgroundColor = slide.bgColor;

I think it's complaining about slide.bgColor

Why are you using obsolete old bgColor instead of slide.style.backgroundColor???

Old Pedant
01-08-2010, 01:20 AM
Oh, never mind!

You will kick yourself.

In your main page, you have this:


slider.bgColor = '#white'; // background-color, ex:'white' or '#eaeaea' (quoted string) - required

Heck, look at the COMMENT there, even!

You can use 'white' *OR* you can use '#ffffff' (both are same thing), but you can NOT put # in front of a color NAME. *THAT* is what MSIE is choking on.

jol
01-08-2010, 02:31 AM
Old Pedant !

Thanks so much for your help - yep, that's a dumb error ! (my speciality)

I corrected it - but I dont have the PC with me .. so I guess I'll have to wait till I get to work tomorrow to find out for sure if that fixes my IE deadlock !

Thanks again for your help !

OP - I'll report back tomorrow : )

jol
01-08-2010, 12:41 PM
Old Pedant - I think I love you !

Thank you so much for your kind help

I've still got some formatting problems .. but I think I can work out the rest

Thank you again - I owe you one !

bazz
01-08-2010, 03:47 PM
Still throwing the same error in IE6. :( says it's a dns error. If you need it to work in IE6, I would search for the problem, by commenting out the js and re-activate each part until the error re-appears. At least that would help to narrow down perhaps to one script, where the problem lies.

Depends on your own site requirements and those of your customer as to whether you need to cater for IE6 now.

bazz

jol
01-08-2010, 06:59 PM
Thanks Bazz .. thanks OP !

Yep - it's still got problems with IE

What a mare !

IE8 looks the best - but even that is not good - the flash menu fails and the formatting's poked on all but the first page (presumably because of the sub-menu on the right)

As for IE7 and IE6 - well, as I said .. what a mare !

So - once again .. any advice is gratefully received

I'll try commenting out some bits and see if I can narrow down the remaining issues

Wonder why the Flash menu doesn't strike up tho' - perhaps it just doesn't get that far

jol
01-08-2010, 10:12 PM
Does anybody want a job ? I'm out of my depth and need to get back to my real job which is carving weird shapes out of wood .. something that's a damn site less infuriating than this : )

Help me fix this in Internet Explorer ?
.. and I will pay you for your help

My Issues In Summary :

- Chrome, Safari, Firefox are all working just fine !
- IE8 has lost the Flash menu and has a formatting problem on all but index.html (due to the right hand sub-menu I guess)
- IE7 has additional formatting issues
- IE6 barfs .. but I'm not sure I care too much about IE6

Old Pedant
01-08-2010, 11:51 PM
IE7 barfs, for me, also. It won't even load your page.

And before you fixed that #white problem, it would at least report an error before it barfed, but now it just silently gives up.

Wish I had time to help, but not right now.

jol
01-09-2010, 12:33 AM
Much Appreciated OP !!

Let me know if you find time or know of anyone else who might give it a bash !

Cheers, Jol

jol
01-09-2010, 10:12 PM
God love s a tryer !!

So .. new testpage!

.. it's stripped it right down ..

www.industrialarts.co.uk/index b.html

you can see here that both my scripts are running in IE8 !!!!!!!

how did I get them both running on the same page ?

.. I removed this ..
<div id="content">

.. and I put in this ..
<body onload="MM_preloadImages(‘http://www.industrialarts.co.uk/Images/bw.gif’)…;initLightbox()">

(I got that bit from the JS Conveyor 2.04 help page)

now I managed this by futzing around because as you guys know by now - I haven't got a clue what I am doing

So .. this must give some clues, right ?

2 scripts are banging heads ? (for IE)

I will send my best donkey to anyone who can help me through this !

Thanks for reading .. hope someone can give some clues as to what's happening here !

bazz
01-09-2010, 10:50 PM
Just with a quick look, your top script works backwards in FF from how it does in IE6, un til you mouseover it. Even then it seems to be a bit fiddly because in FF it doesn't change direction consistently.

As for your second script; I would say to drop it. You could do a more usable navigation menu without javascript (just with html and CSS), so that even those who have it disabled, can get around your site.

my 2c

bazz

jol
01-09-2010, 10:51 PM
Can I assume "content" is being defined here as a variable ?

So .. perhaps that variable is conflicting with another variable in one of the scripts ??

Could that be true ?

... Has Sherlock got competition ?

jol
01-09-2010, 10:58 PM
Thanks Bazz - but not really the answer I'm looking for tho'. I'm trying to understand what's conflicting here

[.. I can control the zones which change the direction of the images .. I prolly need to tune them a bit!

the flash menu is a carry over from my previous site - hence I'd like to keep it - it'a an alternate nav method to CSS (not instead of) - the CSS method up top appears to work just fine !]

Thanks for your input !!

jol
01-09-2010, 11:08 PM
from what I can see prototype.js and effects.js (scripts that are called) both use "content" - I'm guessing as a defined variable

.. could this be my conflict ?

I'm guessing the "body onload" command is just initiating early something that was going to happen anyway ??

.. Apologies again for not knowing what I'm doing - but I'm real keen to nail this problem with IE !

tomws
01-10-2010, 01:29 AM
The body onload() means that those scripts/commands will be executed after the page body is loaded. This is how DOM-modifying scripts should be run (well, maybe not that exact method, but close).

If the script in question was modifying the document before it was ready (fully loaded), that could cause an error which would clog up all or most javascript in IE - at least the older ones. The same error would likely be present in the non-IE browsers, but their javascript might continue to work in other areas.

jol
01-10-2010, 03:57 AM
Hey Tom, OP

I found the perfect solution (for now)

.. check it out !

Thanks for all your help !!!

jol
01-10-2010, 08:08 PM
OK - explain this

- oddly enough in IE8 .. I'm getting it to work "sometimes"

www.industrialarts.co.uk/indexb.html

... sometimes the flash menu loads and sometimes it doesn't. If I keep refreshing - then perhaps 1 in 5 or 10 times, it loads as it should

.. can that be ?

does it give a clue ?

jol
01-10-2010, 10:36 PM
I've been sitting here pressing F5 over and over again in IE8

I see that every 10 or maybe 20 times I refresh, the images in the conveyor - for one reason or another - take a little longer to load

When this happens, the speedway script at the bottom sparks up perfectly - just as it should

So - as an experiment, is there a way to get the speedway script to always start first ?

tomws
01-11-2010, 08:53 PM
Don't you get an error in IE8? I do:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Mon, 11 Jan 2010 19:50:17 UTC


Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
Line: 0
Char: 0
Code: 0
URI: http://www.industrialarts.co.uk/indexb.html



What is this just inside the opening body tag?

<onload="MM_preloadImages(‘http://www.industrialarts.co.uk/Images/bg033.jpg’)…;">

Looks broken to me.

jol
01-11-2010, 09:43 PM
sorry - removed that now - was messing around with preloading

Tom - do you get the sporadic behaviour I explained ?

ie : once in every 5-15 refreshes, the page finishes loading correctly

what could cause such a thing ?

I think I need to try commenting out the .js in turn and see if that gives me a clue .. any thoughts welcome

www.industrialarts.co.uk/indexb.html

tomws
01-11-2010, 11:00 PM
I keep getting the same javascript error I posted. Not sure where that error is coming from, but I see it on every load in IE8.

Here's something to look at on your end. Check a View Source in IE8. Scroll to the bottom. The code here cuts off in the middle of your contact js. Nothing in that grey box shows up here, either.

jol
01-12-2010, 12:45 AM
Many thanks again Tom

Yes - I get that very same error - but addresses like char 0, line 0, code 0 aren't really so useful

Most of the time, IE doesn't make it to page-end .. I just wonder why sometimes it does

I'll keep plugging away - .. ever wish you'd never started something ?

tomws
01-12-2010, 02:27 AM
On my system here at home, IE8 fails a complete load on the first try, but successfully loads after that. Restarting the browser makes it happen again.

My guess is that one of the scripts that are scattered all throughout the code is attempting to do its thing before the container is finished loading. The only fix for that is to clean up the code and arrange it according to good programming practice. Stick all of the scripts in the head tag, or else put them in external files and load them in the head. Wait to run them until the document is ready.

Something else you can do is to look at your doctype again. According to the validator (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.industrialarts.co.uk%2Findexb.html&charset=%28detect+automatically%29&doctype=Inline&group=0), it's still incorrect. IE is bad enough with a good doctype; it's probably going to be worse with a bad one.