473,395 Members | 1,987 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,395 software developers and data experts.

Retain Text Formatting From Web Page

Apologies for the almost duplicate post but thought this was much
clearer description of the issue than what I originally posted.

I'm trying to do simple integration with a third-party
web application. The app has an 'Action' button on all pages that
can be associate with a JS function. Our application is very
proficient
at parsing text provided it is in some reasonably standard structure.

Is what we are trying to do is have a JS function that can be called
from
any page in their system that will provide a reasonable representation
of the text on the screen. I need something close to
document.body.innerText; the problem with this function is that it
strips spacing from tables so we can't get consistent layout.

The consistent layout I am looking for would be the same as if you did
the following on any page:
1) Select all
2) Copy
3) Paste to notepad

Is there a function or process that will retrieve all text and retain
formatting?

Dec 1 '06 #1
2 1729
wrote on 01 dec 2006 in comp.lang.javascript:
Apologies for the almost duplicate post but thought this was much
clearer description of the issue than what I originally posted.

I'm trying to do simple integration with a third-party
web application. The app has an 'Action' button on all pages that
can be associate with a JS function. Our application is very
proficient
at parsing text provided it is in some reasonably standard structure.

Is what we are trying to do is have a JS function that can be called
from
any page in their system that will provide a reasonable representation
of the text on the screen. I need something close to
document.body.innerText; the problem with this function is that it
strips spacing from tables so we can't get consistent layout.

The consistent layout I am looking for would be the same as if you did
the following on any page:
1) Select all
2) Copy
3) Paste to notepad

Is there a function or process that will retrieve all text and retain
formatting?
..innerHTML

and then paste it into a new <div>

[.innerText is IE only, it seems]
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dec 1 '06 #2
ASM
Evertjan. a écrit :
>Is there a function or process that will retrieve all text and retain
formatting?

.innerHTML

and then paste it into a new <div>

[.innerText is IE only, it seems]
Prefer (if IE compliant ?) :
document.body.appendChild(popup.document.body.clon eNode(true));

copi = popupWindow.document.getElementById('aDiv').cloneN ode(true));
document.getElementById('bDiv').appendChild(copi);

see :
http://stephane.moriaux.perso.wanado...nerHTML_danger
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Dec 1 '06 #3

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

Similar topics

2
by: theo | last post by:
Hi... I wish to extract the text content of an Xml file and assign it to DropDownList controls at runtime.I can get the Xml file text content into the DropDownList controls (Ex...if 5 Xml text...
3
by: Penny Bond | last post by:
Hi, Any help or suggestions on this one would be gratefully appreciated: I have 2 aspx pages one is called 'Query' and the other 'Details'. Query page has a number of text boxes and drop...
3
by: Rigga | last post by:
Hi all, Firstly, sorry for the simple question, as i'm sure i'm missing something obvious. I have a text field (varchar) I am reading from an SQL db, into a string variable, in .NET I am...
3
by: ANTISPAM_garycnew_ANTISPAM | last post by:
What is the simplest way to retain the last option value selected in an html select object using javascript? I am currently using a server-side cgi language to accomplish this task, but it adds...
1
by: amit | last post by:
Hey guys I am trying to develop an application which would open an word file (.doc) and split it into multiple files. I want to create seperate file for tables, so the application should just...
3
by: raaman rai | last post by:
Hi Fellas, i need to understand how to retain the submtted form values during an Edit/Update operation. When i add the information from a form, i retain the form values in the following way incase...
3
by: =?Utf-8?B?b24tbGluZSBqb3VybmFsIGVkaXRvcg==?= | last post by:
I can't seem to cut-and-paste text, with either .doc or .html formatting, into my .asp web-pages --all the formatting is lost. Is there some code that needs to be added to the page that will...
6
by: =?Utf-8?B?Rmx5Z3V5?= | last post by:
I am trying to keep from reloading my XmlDocument every time my page reloads. To do this I am using ViewState. System.Xml.XmlDocument myDataXmlDoc = new System.Xml.XmlDocument();...
2
by: qwedster | last post by:
Folks! The following is a "Hello World" kind of code for ViewState. I just want to know how to retain the ViewState 1) while Page Refresh when using UpdatePanel and also 2) While I reverting back...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.