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

Using JS "WRITE" type functionality without erasing the original page.

Is it possible? I'm trying to add to the current page -- but add at a
specific point. Can add HTML tags from javascript midway through the page
(at a place I specify) without erasing the existing page?

Thanks,
Eric
Jul 20 '05 #1
5 4878
In article <bf************@ID-144898.news.uni-berlin.de>, "Eric"
<um**@psyon.org> writes:

Is it possible? I'm trying to add to the current page -- but add at a
specific point. Can add HTML tags from javascript midway through the page
(at a place I specify) without erasing the existing page?

Try reading the group FAQ at http://www.jibbering.com/faq/
and specifically http://www.jibbering.com/faq/#FAQ4_15

--
Randy
All code posted is dependent upon the viewing browser
supporting the methods called, and Javascript being enabled.
Jul 20 '05 #2
Right -- but DOM2 isn't universally supported (not that javascript is -- but
I wanted to do a little bit better than IE5). Is this my only option?

Thanks,
Eric
Jul 20 '05 #3
"Eric" <um**@psyon.org> writes:

Please keep a little of the post you are answering so we can see wha
you refer to.
Right -- but DOM2 isn't universally supported (not that javascript is -- but
I wanted to do a little bit better than IE5).
What does IE5 do, and what would be better?
Is this my only option?


(the one in the FAQ?)

It is a *good* option. It works in IE4+, NS6+ and Opera 7.

The code is not very pretty, though. Try this instead:
---
function writeHTML(id,S) {
var elem = (document.getElementById ? document.getElementById(id) :
(document.all ? document.all[id] : undefined));
if (!elem) { return false; }
elem.innerHTML = S;
return true;
}
---
It works in any browser that understands .innerHTML. Adding support
for NS4 requires some extra work, but is possible if the element
to write into is absolutely positioned.

I don't know what other browsers are out there that allows changing
the contents of the page dynamically.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #4
On Mon, 21 Jul 2003 00:02:17 -0700, "Eric" <um**@psyon.org> wrote:
Right -- but DOM2 isn't universally supported (not that javascript is -- but
I wanted to do a little bit better than IE5). Is this my only option?

If you don't want to use innerHTML etc. then you could include a
JavaScript document.write() in the HTML document at the appropritate
point.

If you need to alter is after the HTML page hase rendered then reload
the page with the variables driving the document.write() primed to
include the new data.

This might require using data saved in another frame, or cookie etc.

HTH
Jul 20 '05 #5
I never even thought of placing the document.write statement within the
document as opposed to the beginning or end of the document.

Thanks!
Jul 20 '05 #6

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

Similar topics

0
by: mc kim via .NET 247 | last post by:
What I am trying to is automatic bidding process in Ebay site... WebClient class can uploads form data easily. I have collected ebay url & form data to uploads.. Most of process is quite easy...
2
by: bissatch | last post by:
Hi, I am trying to use JavaScript to write a table column on a web page. The code is as follows: <html> <head> <script> function displaycount() {
9
by: mallyonline | last post by:
I last posted to this group about 6 months ago and was very pleased by the excellent response I got and the great help offered to me. I am back this time with another request for your expert help...
34
by: John Harrison | last post by:
An odd confession; an odd request; but here's the tale.... My company has a few PC systems which we have used for about 7 years and not updated - we've "made do", and besides, "if it ain't...
10
by: Stuart Brierley | last post by:
Does anyone have any ideas how to open a new web browser window in .NET? I'm using ASP.NET with VB as the code behind, and after some (server side) validation code may need to open a second...
4
by: bennett | last post by:
How can I do a loop from 1 to 5, where on line 1 I print 1 space followed by a button, on line 2 I print 2 spaces followed by a button, on line 3 I print 3 spaces followed by a button, etc.? I...
0
by: Benny | last post by:
I'm testing to see whether msbuild can replace nmake. project file <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Target Name="test"> <Exec Command="test.exe"/>...
3
by: cc50818j | last post by:
Hi, Can anyone suggest a Unix command or c-shell algorithm to simulate to behavior of "wall" command minus the "all users"? What I'm trying to do is to send a notice to just one particular user...
1
by: Curious | last post by:
I want to write to an output file, "C:\\temp\\debug.txt": If the file exists, append the new content to the end of the file (instead of overwriting the current content). If the file doesn't exist,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.