By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,244 Members | 1,375 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,244 IT Pros & Developers. It's quick & easy.

onclick in netscape

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
"Jon" <jon@SPAM_OFFtheexperts.co.uk> wrote:
<a href="#">


Write a correct HREF and not such nonsense.
Jul 20 '05 #2

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.