View Full Version : Simple Controls Gallery v1.3 - The word "null" shows in IE

04-04-2009, 04:13 AM
1) Script Title: Simple Controls Gallery v1.3

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/simplegallery.htm

3) Describe problem: In IE in the upper left of the div, the word "null" shows. How can I get rid of it? It looks fine in Firefox and Safari. Here's a link so the problem can be viewed (must use IE to see the issue): http://www.silverstreetva.com/Gallery3.asp

Additionally: Is there a way to make the boxes that hold the text and/or controls always visible?


04-06-2009, 06:35 AM
Hmm at a glance I can't see why it's doing that actually. Just to test things out, what happens if you create a blank page, and just have the Simple Gallery script on it?

04-06-2009, 08:32 PM
I'll check it out and send you the link. Thanks, H.L.

04-06-2009, 08:54 PM
OK. Unfortunately (for me anyway) it works fine on a blank page. So I just need to figure out what in my header is causing it.

04-07-2009, 12:54 AM
I can't find any reason for this. It works on the blank page just fine. The markup validates. The css has only 4 errors which are the use of the overflow-x and overflow-y properties and those properties are absent on this page. Any suggestions? I hate IE!

04-12-2009, 02:39 PM
Little bump... Anyone have any ideas?

04-12-2009, 03:32 PM
There are four places in the script where an element or elements are having their innerHTML property set to null. Technically this is supposed to be the same as setting it to an empty string. However, some browsers (not just IE) will render this as the literal word 'null'. That's what's happening here. So you could change those all to:

.innerHTML = '';

However, IE 8 sometimes has a problem with that. And the proper way to empty an element is to remove all of its child nodes. So I've made up a version of the script that does just that, and it appears to solve the problem. Here it is (attached):


04-12-2009, 06:47 PM
Amazing! You rock! I looked at those NULL as literals, but thought I'd try here first. I edited the script further and added another "oninit" handler to get the navpanels to remain visible. Thanks so much for all of the help!

04-13-2009, 08:39 AM
Nice work John! I suspected it had something to do with IE's mishandling of null, but didn't have a chance to really look into the issue. I might incorporate your fix into the script the next time it's updated.