There is such a task, to embed an iframe with a document into the page. This beauty is downloaded from the third site and through JavaScript:

  1. from the service asynchronously get such a tag

     <script type="text/javascript" src="https://secure.na1.echosign.com/public/embeddedWidget?wid=CBFCIBAA3AAABLblqZhCLlCGc-XhVQGnsG_NX5Xls1tBCDqCPE-Xz-zk8X_ooGxKzIxxyZ6oKL6iCqsAHLS8*"></script> 
  2. Paste it into the innerHTML block where you need to display the form. But it does not work.

  3. If we execute the link in the browser directly, we get:

     document.write('<iframe src="https://secure.na1.echosign.com/public/esignWidget?wid=CBFCIBAA3AAABLblqZhCLlCGc-XhVQGnsG_NX5Xls1tBCDqCPE-Xz-zk8X_ooGxKzIxxyZ6oKL6iCqsAHLS8*&hosted=false&token=&firstName=&lastName=&nameEditable=true" width="100%" height="100%" frameborder="0" style="border: 0; overflow: hidden; min-height: 500px; min-width: 600px;"></iframe>'); 

How can I make it all work?

    1 answer 1

    You need to insert somewhere, if you insert it into the body , then this is how it works:

     var html = '<iframe src="https://secure.na1.echosign.com/public/esignWidget?wid=CBFCIBAA3AAABLblqZhCLlCGc-XhVQGnsG_NX5Xls1tBCDqCPE-Xz-zk8X_ooGxKzIxxyZ6oKL6iCqsAHLS8*&hosted=false&token=&firstName=&lastName=&nameEditable=true" width="100%" height="100%" frameborder="0" style="border: 0; overflow: hidden; min-height: 500px; min-width: 600px;"></iframe>'; document.body.innerHTML = html; "https://secure.na1.echosign.com/public/esignWidget?wid=CBFCIBAA3AAABLblqZhCLlCGc-XhVQGnsG_NX5Xls1tBCDqCPE-Xz-zk8X_ooGxKzIxxyZ6oKL6iCqsAHLS8*&hosted=false&token=&firstName=&lastName=&nameEditable=true" width = " var html = '<iframe src="https://secure.na1.echosign.com/public/esignWidget?wid=CBFCIBAA3AAABLblqZhCLlCGc-XhVQGnsG_NX5Xls1tBCDqCPE-Xz-zk8X_ooGxKzIxxyZ6oKL6iCqsAHLS8*&hosted=false&token=&firstName=&lastName=&nameEditable=true" width="100%" height="100%" frameborder="0" style="border: 0; overflow: hidden; min-height: 500px; min-width: 600px;"></iframe>'; document.body.innerHTML = html; 

    If specifically in a block, then by ID , you can like this:

     document.getElementById('id').innerHTML = html; 
    • The fact is that it was supposed to embed the original Script. I had to convert it into an IFrame, because I threw the error: Failed to execute it: it was explicitly opened. - Evgen