473,394 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

onclick in netscape

Jon
Hi,

I have an iframe in a cell:

<td id="contents" width="643">
<iframe width="643" height="232" src="home.asp" frameborder="0"
scrolling="no"></iframe>
</td>

<td onClick="document.all.contents.innerHTML='<iframe width=643 height=232
src=home.asp frameborder=0 scrolling=no></iframe>';"><a href="#"><img
name="home_r2_c3" src="images/home_r2_c3.gif" width="97" height="26"
border="0" alt="Home Page"></a></td>
In IE, all is well, I click the cell and the iframe changes to the required
page, but this totally fails in Netscap.

Is there away around this please?

Thanks

Jon
Jul 20 '05 #1
4 2790
"Jon" <jon@SPAM_OFFtheexperts.co.uk> wrote:
<a href="#">


Write a correct HREF and not such nonsense.
Jul 20 '05 #2
In article <c0**********@titan.btinternet.com>,
jon@SPAM_OFFtheexperts.co.uk enlightened us with...

<td id="contents" width="643">
<iframe width="643" height="232" src="home.asp" frameborder="0"
scrolling="no"></iframe>
Gee, I sure hope you made sure I didn't really need that to scroll.
Good thing I'm not visually impaired and need to increase the font size.
The content would probably be all over the place.
</td>

<td onClick="document.all.contents.innerHTML='<iframe width=643 height=232
src=home.asp frameborder=0 scrolling=no></iframe>';"><a href="#"><img
name="home_r2_c3" src="images/home_r2_c3.gif" width="97" height="26"
border="0" alt="Home Page"></a></td>
In IE, all is well, I click the cell and the iframe changes to the required
page, but this totally fails in Netscap.

Is there away around this please?


document.all is IE proprietary.
Stop that.

innerHTML will not work in NN4. Well, I don't think iframes do, either,
and neither does an onClick of TD, so you must have meant Netscape 6. Or
maybe you meant Netscape 7. Hard to tell. You didn't say.

For IE5+, Opera5+, Mozilla, and Netscape 6...
Use document.getElementById.
if (document.getElementById)
{
document.getElementById("contents").innerHTML = "whatever";
}

Also, <a href="#"> is rarely, if ever, needed.
You want an img to do something then use onClick. If supporting NN4, use
an anchor as a wrapper, but give it a real href, not #.

HTH
--
--
~kaeli~
The secret of the universe is @*&^^^ NO CARRIER
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #3
Jon wrote:
<td onClick="document.all.contents.innerHTML= In IE, all is well, I click the cell and the iframe changes to the
required page, but this totally fails in Netscap.


This is a JavaScript issue, not an HTML issue - and the problem is not to do
with onclick, its to do with your use of the non-standard Microsoft DOM.

http://devedge.netscape.com/viewsour...tml-web-pages/

and try comp.lang.javascript next time you have JavaScript problems.

--
David Dorward <http://dorward.me.uk/>
Jul 20 '05 #4
Jon

"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...

<SNIPPED>
Is there away around this please?


document.all is IE proprietary.
Stop that.

innerHTML will not work in NN4. Well, I don't think iframes do, either,
and neither does an onClick of TD, so you must have meant Netscape 6. Or
maybe you meant Netscape 7. Hard to tell. You didn't say.

For IE5+, Opera5+, Mozilla, and Netscape 6...
Use document.getElementById.
if (document.getElementById)
{
document.getElementById("contents").innerHTML = "whatever";
}

Also, <a href="#"> is rarely, if ever, needed.
You want an img to do something then use onClick. If supporting NN4, use
an anchor as a wrapper, but give it a real href, not #.

HTH
--
--
~kaeli~
The secret of the universe is @*&^^^ NO CARRIER
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Kaeli,

That was very useful, thank you.
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jez | last post by:
Hi, I've created a function which opens a popup window containing a calendar. When a day is clicked, the date is entered into a text box on the parent page and the popup is closed. The link...
2
by: mscir | last post by:
I was calling a function in a js file from an image onClick event, but someone still using Netscape 4 (!) complained that it didn't work. I read that img onClick doesn't work in Netscape 4, so...
2
by: kelvin | last post by:
Hi, I've this piece of code which does not work at all. Can anyone point out my mistake? I've 2 buttons. History button will call verifyFields() function and lead to different page for...
5
by: Mike | last post by:
In my previous post, I wrote: > ... > GOAL: (very simple) Provide a hyperlink which, when clicked, > calls a javascript function which opens a new URL. > ... > PROBLEM: The following code...
5
by: Gerard van Wilgen | last post by:
I noticed that the following line of code works in IE 6 but not in Netscape 7.1: <INPUT TYPE="radio" NAME="selComb" VALUE="0" ONCLICK="alert(selComb.value)"> Nothing happens when I click on...
2
by: RobG | last post by:
I am trying to dynamically add an onclick to an element, however I just can't get the syntax right. consider the following function: function doClick (evt,x) { // do things with evt and x } ...
5
by: moondaddy | last post by:
I have a <a> element in a datagrid which wraps some asp.net labels. this element also has an onclick event which does not fire in netscape 6 (and perhaps other browsers for all I know...). Below...
3
by: topherknowles | last post by:
Hello, I have a number of links opening in a fixed window that certain users cannot access because they are on netscape 4.6 (I think this can handle the links and it is actually their ancient...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.