Click to See Complete Forum and Search --> : text/image swap onclick
bmoremus
12-14-2002, 03:43 PM
I have been having with a page I just put up: http://highshear.com. It works just like I wanted it to in MSIE but when I View it in Netscape 4, the scripts aren't processed.
Okay, what is supposed to happen is that when you click on a link in the left bar, the image and text in a table cell in the center column should change. when you click on a link in the right bar, a different table cell in the center column changes. LikeI said, when I view it in MSIE 5.5 it works.
Please let me know if you need more info.
Holly
http://highshear.com bmoremus@yahoo.com
gil davis
12-14-2002, 04:22 PM
NS 4 does not support "document.all" or "innerHTML". The only way to replace text is by using "document.write()" to a layer or other positioned object.
For an in-depth study of the NS 4 object model, see http://developer.netscape.com/docs/manuals/js/client/jsref/index.htm
Your page will also fail in NS 6+ and Mozilla. You need to look into the W3C DOM methods like "document.getElementById()".
bmoremus
12-14-2002, 05:09 PM
great, thanks... I have a follow up question, though:
will document.write.CELL doesn't work the same way so would you recommend layers?.. or maybe you have a better idea?
Thanks again, Holly
gil davis
12-14-2002, 08:10 PM
Your page is designed using a table. NS 4 has a problem mixing tables, layers and document.write(). The layer has to be "position: absolute" to work correctly, and that means the content is not included in the flow of the document - which makes tables not work correctly.
The best approach would be to not use a table for layout purposes, and instead use a positioned object. Both browsers can use this approach, but it means lots of rework for you. A DIV with style="position: absolute" can be used to save some of the cross-browser pain.
With the way your page is laid out, you might consider using an <IFRAME> for IE and NS 6+, and <LAYER> for NS 4. You can create separate HTML files for the center part and load them into the <IFRAME> or <LAYER> by changing the SRC attribute. You could then take advantage of the standard anchor behaviour when your guest does not have javascript enabled.
<a href="groutmixer.htm" onclick="show(this.href);return false">
If JS is not enabled, this will load the page groutmixer.htm into the window. If JS is enabled, the function "show()" is called with the file name to be displayed in the <IFRAME> or <LAYER>.
I have posted an example of this suggestion at
http://gil.davis.home.att.net/pics.htm
HTH
bmoremus
12-15-2002, 09:53 PM
That's great... you are a really big help... I guess I've got a little work ahead...
oh, and I saw your shuttle patches at your site... I think I actually have a few of them somewhere.
Holly