0

So I'm trying to get a url I have stored in the clipboard to render in my iframe via url.

Not sure what to make of this code.

<iframe id="showskill" scrolling="yes" height="100%" width ="100%" src=""+ ReturnURL()></iframe>
<script>
function ReturnURL() {    
    var el = document.createElement('textarea');
    document.body.appendChild(el);
    el.focus();
    document.execCommand('paste');
    var value = el.value;
    document.body.removeChild(el)
    return value;
}
console.log(getClipboard());
</script>

Suggestions welcome.

  • Ry3yr

Edit: This looks like a step in the right direction ? How to use javascript variable in iframe src Edit2: New code, same fate...

Rye
  • 49
  • 5
  • I think you are not using the promise right – sc0rp1on Nov 04 '21 at 16:10
  • Are you using come sort of templating language? Your JS and HTML are rather mashed together in a way that is definitely not valid on its own (HTML inside a script tag) – DBS Nov 04 '21 at 16:37
  • I'm calling an html-iframe from javascript, because I hoped I could (that way) pass the clipboard content to the iframes "src" field. I got the code from https://stackoverflow.com/a/8726661/3708093 – Rye Nov 04 '21 at 16:38

0 Answers0