/    Sign up×
Community /Pin to ProfileBookmark

text/image swap onclick

I have been having with a page I just put up: [url]http://highshear.com.[/url] 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
[URL=http://highshear.com]http://highshear.com[/URL] [[email protected]][email protected][/EMAIL]

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisDec 14.2002 — 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()".
Copy linkTweet thisAlerts:
@bmoremusauthorDec 14.2002 — 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
Copy linkTweet thisAlerts:
@gil_davisDec 15.2002 — 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.

[font=courier]<a href="groutmixer.htm" onclick="show(this.href);return false">[/font]

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
Copy linkTweet thisAlerts:
@bmoremusauthorDec 16.2002 — 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
×

Success!

Help @bmoremus spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...