/    Sign up×
Community /Pin to ProfileBookmark

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: [url]http://www.retailmenot.com/[/url] 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.)

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@MrRedApr 29.2010 — 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.
Copy linkTweet thisAlerts:
@jagardaauthorMay 02.2010 — 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

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.[/QUOTE]
Copy linkTweet thisAlerts:
@MrRedMay 04.2010 — 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.
×

Success!

Help @jagarda spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...