Copy Functionality w/o Using Copy/Paste Buffer

A

al_johnson222

From any page, I want to be able to call a JS function that will do the
equivelant of select all, and copy. This data will then be posted to a
page that will log it.

This would be easy using copy/paste functionality but I don't want to
screw-up users copy/paste buffer. Anyone have an example of how to
retrieve all text with similar formatting of copying page to notepad
without using copy/paste functionality? Thanks in advance.

Al
 
A

al_johnson111

Danny said:
There is no access to the clipboard object on the client environment, with the
sole exception of IE dataTransfer object which does allow it, so you'd have to
be a bit more specific. If you mean to have it cross by means of some shared
object daemon or such from browser, no dice, you'd still need to use the
clipboard on most if not all, and depending on the page, it may be big or not.

Danny

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

Is what I am 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 data 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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top