473,671 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="docume nt.all.contents .innerHTML='<if rame width=643 height=232
src=home.asp frameborder=0 scrolling=no></iframe>';"><a href="#"><img
name="home_r2_c 3" 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 2813
"Jon" <jon@SPAM_OFFth eexperts.co.uk> wrote:
<a href="#">


Write a correct HREF and not such nonsense.
Jul 20 '05 #2
In article <c0**********@t itan.btinternet .com>,
jon@SPAM_OFFthe experts.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="docume nt.all.contents .innerHTML='<if rame width=643 height=232
src=home.asp frameborder=0 scrolling=no></iframe>';"><a href="#"><img
name="home_r2_c 3" 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.getEle mentById.
if (document.getEl ementById)
{
document.getEle mentById("conte nts").innerHTM L = "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="docume nt.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.javas cript next time you have JavaScript problems.

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

"kaeli" <ti******@NOSPA M.comcast.net> wrote in message
news:MP******** *************** *@nntp.lucent.c om...

<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.getEle mentById.
if (document.getEl ementById)
{
document.getEle mentById("conte nts").innerHTM L = "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
167420
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 I'm using on the parent page is ... <a href="#" onClick="popupcal()">choose date</a>
2
1463
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 swithced it to "javascript:show(...);" and the code works, but I read in this group that it was not wise to do that, here's the working version, using the not recommended approach: <a href="javascript:show('art_2.jpg','600','448');" target="_self">...
2
2414
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 processing. verifyFields() is working fine and so does the history() function.
5
10871
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 works fine if I click to open in > the same window, but if I click the browser option to open in a > new window, the new window tries to open the href URL (the > onClick function does get executed, but seems to be ignored). > ...
5
1457
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 the radio button. There is not even an error message. This is a simplified version of the actual code, which is used to pass among
2
18567
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 } Which is called statically by: <button onclick="doClick(event,this);">Click me</button>
5
2577
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 is the code for this. the onclick event calls a javascript function which I put an alert in the firt line to tell me if its working. It does work in IE. Any ideas on how to get netcrap... oops, I'm sorry, netscape to fire the onclick event? ...
3
1662
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 computers which cannot, but either way they are all on netscape), the current onclick command looks like this: <A onclick="wopen('page url', 'popup', 670, 395); return false;" href="page url" target=popup> which activates this script: <SCRIPT>...
0
8476
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8393
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8917
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8821
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8598
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7437
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
2812
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1809
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.