Copy Functionality w/o Using Copy/Paste Buffer

Discussion in 'Javascript' started by al_johnson222, Nov 28, 2006.

  1. 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
     
    al_johnson222, Nov 28, 2006
    #1
    1. Advertisements

  2. 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?
     
    al_johnson111, Dec 1, 2006
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.