By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,480 Members | 1,214 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,480 IT Pros & Developers. It's quick & easy.

Copy Functionality w/o Using Copy/Paste Buffer

P: n/a
>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

Nov 28 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

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
Nov 28 '06 #2

P: n/a

Danny wrote:
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?

Dec 1 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.