HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 15th, 2000, 06:14 AM
grisou grisou is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 1 grisou User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I need to change the text in a table cell, or just any text, like
<SPAN id=iddiv>
TEXT
</SPAN>
I found this
document.all[id].innerHTML = text
on this very forum for IE4,
but the snipet for NS4 I don't get to work:

document.layers[id].document
lyr.open()
lyr.write(text)
lyr.close()

What is missing?
What is the difference using SPAN or DIV?

Following is the full source,
thank you for helping,

*Henning

<HTML>
<HEAD>

<script>
function WriteIt(id, nestref, text)
{
//if(ns4)
{
var lyr = document.layers[id].document;
lyr.open();
lyr.write(text);
lyr.close();
}
//else if (ie4)
// document.all[id].innerHTML = text
}
</script>

</HEAD>
<BODY>

This is the
<SPAN id='iddiv'>
text
</SPAN>
.
<p>
<a href="javascript:WriteIt('iddiv',null,'NEW TEXT')">go</a>

</HTML>

*Henning



[This message has been edited by grisou (edited May 15, 2000).]

Reply With Quote
  #2  
Old May 16th, 2000, 07:42 AM
firepages's Avatar
firepages firepages is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: Perth West Australia
Posts: 741 firepages User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Hi Henning - is your <span></span> nested in any other <span>'s or <div>'s if it is you need to tell netscape explicitly where it is ie: if you have a div called <div id=MyDiv> and in it a span called <span id=mySpan>,

Then to reference MyDiv you would have to use -var lyr = document.MyDiv.document.layers[id].document; // where id=MySpan.

Hope this is the problem.

Regards,
Simon.

------------------
Simon Wheeler
FirePages -DHTML/PHP/MySQL

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Changeing Span Text


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway