Skip to content
Advertisement

Parse and add url from clipboard

I need a javascript bookmark to take the url I have in the clipboard parse out the 2 numbers and create a new url, and add a link to the top of the page, that when clicked adds the url to my bookmark menu.

Say I have url’s like these

http://www.website.com/frontpageeditor.jhtml?sectionID=2844&poolID=6276
javascript:getPoolPageUrl(9800,22713)

Then I need to add the numbers to this url

javascript:frames['content'].getPoolPageUrl(9800,22713)

and then add the url to the top of the frame “content”.

I have tried forever on this, but I can’t figure out it out.



Update
I’ve put something together, to show you what I need. This one doesn’t work though.

Any ideas why?

JavaScript



Update2
This works. Any changes I can do to make it even better?

JavaScript

Advertisement

Answer

Ok, first of all I think you cannot retrieve the text from clipboard from java script, my guess that it would be a major security issue if you can.

Let’s assume you have the clipboard in a string you can call this function:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement