dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: help with click-to-copy-into-clipboard function and open new frame/page

Hybrid View

  1. #1
    Join Date
    Apr 2010
    Posts
    3

    help with click-to-copy-into-clipboard function and open new frame/page

    Hi,

    Im currently building a new discount-webpage and Im looking for a solution to be able to hover over a discount button to reveal a small text without clicking. And after clicking on the button that the text in the flash button is copied into the clipboard and a new page open with a small frame from my window with the new page underneith. examples of this kind of script can be viewed on this page: http://www.retailmenot.com/ on the yellow boxes with the discount text.

    Im not looking for someone to do this for me. All I want to know if there is another language to do this with like possibly java? and maybe some links to tutorials. (the current page solves this with flash which I havent worked with before.)

  2. #2
    Join Date
    Feb 2009
    Location
    UK
    Posts
    142
    using the clipboard in JavaScript Client-side is not possible. According to many reports.

    Server-side scripts I am not sure about. But there are many ways to do this in JavaScript Client-side that does not use the OS 'clipboard'. It really depends on how much formatting you want to carry across. Simple text (or URL) can be placed in frames or layers with the .innerHTML property (JavaScript) from one frame to the next via the parent. or to a DIV layer (using id's to find the layer as an object). I am playing with this at the moment. By constructing all the HTML code in a variable the world is your oyster.

    If you go "JavaScript" have a look at http://www.users.waitrose.com/~cresby/stroudFMold.htm - the Script that you may benefit from (as a guide) is in the .htm document itself. I create a panel of all the hyperlinks in the rest of the document and sort and present them in a table. click where it says Alphabetical. Though keep in mind the DIV layer. The code may be clunky - but it does the job in very difficult circumstances (like IE & FF not behaving the same.)

    Best of luck. It is a work in progress so grab one copy soon and work your own magic.

  3. #3
    Join Date
    Apr 2010
    Posts
    3
    Thanks for the help! Ive been reading a bit on java and there seems to be alot of trouble with copy-paste into clipboard that flash doesnt have, at least not yet. I think ill search a bit on how to do this in flash as it seems to be the best alternative

    Quote Originally Posted by MrRed View Post
    using the clipboard in JavaScript Client-side is not possible. According to many reports.

    Server-side scripts I am not sure about. But there are many ways to do this in JavaScript Client-side that does not use the OS 'clipboard'. It really depends on how much formatting you want to carry across. Simple text (or URL) can be placed in frames or layers with the .innerHTML property (JavaScript) from one frame to the next via the parent. or to a DIV layer (using id's to find the layer as an object). I am playing with this at the moment. By constructing all the HTML code in a variable the world is your oyster.

    If you go "JavaScript" have a look at http://www.users.waitrose.com/~cresby/stroudFMold.htm - the Script that you may benefit from (as a guide) is in the .htm document itself. I create a panel of all the hyperlinks in the rest of the document and sort and present them in a table. click where it says Alphabetical. Though keep in mind the DIV layer. The code may be clunky - but it does the job in very difficult circumstances (like IE & FF not behaving the same.)

    Best of luck. It is a work in progress so grab one copy soon and work your own magic.

  4. #4
    Join Date
    Feb 2009
    Location
    UK
    Posts
    142
    I am not sure why the clipboard is so fundamental.

    But:

    I have been collecting the contents of webpages in VBA from Excel where I need the contents of a page outside of the browser. It has to use IE though unless you are really knowledgeable about FireFox. If you are serious about needing the data outside of the browser - I can post the principle code that I used to collect Eurosport TV schedules off their website and filter for chosen sports. I still have it somewhere though I use a different method due to them changing their site.

    Otherwise Frames and DIV layers are the best way to go. Or get heavily into server-side programming.

    Flash has a few limitations. It all depends on your target audience and you cannot guess what they are doing from your own small sample of one, (and a few friends). It is anarchy out there.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles