473,396 Members | 2,076 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,396 software developers and data experts.

How to have a variable text on a webpage

Today I display a placeholder '.' on my webpage with
<h3 id = "MyPlaceholder">.</h3>

Later in my JavaScript I change the placeholder '.' to something else (e.g.
'My new text')
document.getElementById("MyPlaceholder").firstChil d.replaceData(0,
document.getElementById("MyPlaceholder").firstChil d.nodeValue.length, "My
new text");

In general this works great. But the command replaceData() does not exist in
IE 5.5.
Is there any other possibility to do what I'd like to do?

Stefan
Nov 24 '05 #1
2 1253
Stefan Mueller wrote on 24 nov 2005 in comp.lang.javascript:
Today I display a placeholder '.' on my webpage with
<h3 id = "MyPlaceholder">.</h3>

Later in my JavaScript I change the placeholder '.' to something else
(e.g. 'My new text')
document.getElementById("MyPlaceholder").firstChil d.replaceData(0,
document.getElementById("MyPlaceholder").firstChil d.nodeValue.length,
"My new text");

In general this works great. But the command replaceData() does not
exist in IE 5.5.
Is there any other possibility to do what I'd like to do?


just put it there:

<div id = 'MyPlaceholder'>Old Text.</div>

................

document.getElementById('MyPlaceholder').innerHTML =
'My new text.';
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Nov 24 '05 #2
> just put it there:

<div id = 'MyPlaceholder'>Old Text.</div>

...............

document.getElementById('MyPlaceholder').innerHTML =
'My new text.';


Great, that's works on every browser and it's even much less complicated
than my try.

Many thanks
Stefan
Nov 24 '05 #3

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

Similar topics

6
by: Hansan | last post by:
Hi all. I am working on a webpage where I use python and html. When I want to send one variable to a new script/page I use the following code: 0) print '''<input type=hidden name="eventid"...
8
by: hb | last post by:
Hi, I need to declare a variable who's value can be preserve through the same ASP.Net page. I tried the following code, only the static variable s2 keeps its value=22 after lnk1_Click followed...
3
by: Tarren | last post by:
Hi: In Visual Basic is there the equivalent of a Session variable where I can store variables in memory while the executable is running? I have been coding ASP .NET for some time, but am new to...
6
by: InfiniteVoid | last post by:
Hello on my page when viewed with IE the spacing between the text in the tables is close together. When I view my page in firefox the spacing between the text lines it very spaced out. Any way to...
1
by: Hexman | last post by:
Code below ---- I'm trying to save some specific web pages to disk as text files. I searched the Internet and found a basic example which I changed to fit my needs. I tested it out first on a...
2
by: go2bee | last post by:
How to do import/copy text from webpage <textarea> and <text> to text in form MS-Access97 Thankyou.
0
by: go2bee | last post by:
How to do import/copy text from webpage <textarea> and <text> paste to text in the form MS-Access97 Thankyou!
3
by: Sharon | last post by:
hello all, I was successfull in passing one value from first webpage to second webpage, but not sure how to pass three textbox values from the first page to the second page. Below is the code i...
1
by: jlt206 | last post by:
This code <?php include("counter.php")?> on the webpage produces the count number. (function code below) I want to place the current number into a variable $MemberNo or into a FormField to be sent...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.