1

I integrate the Adobe EchoSign on our website. But when i make a call with ajax for EchoSign to display the widget i get this error in console:

Failed to execute 'write' on 'Document': 
It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened. 
widget?f=9K4JRD4I7H`2U3Q&token=SSGROXIB69QCKZBMSSEL6ARM&_=1406108929150:1

I spend already 2 days to find where is the problem but i can figure it out. Actually when the widget is loaded it contains a script and an iframe, in my case is loading the script and after can not do this document.write('the iframe here')....

I am using wordpress, maybe there is a conflict into wordpress?

my call with ajax :

$('#my_id').html('').load('/my_EchoSign.php', function(){

});

and here is the php:

$file = EchoSign\Info\FileInfo::createFromFile($filepath);

$widget = new EchoSign\Info\WidgetCreationInfo('Test createPersonalEmbeddedWidget', $file);

$personalization = new EchoSign\Info\WidgetPersonalizationInfo($recipient_email);

try{
    $result_sign = $api->createPersonalEmbeddedWidget($widget, $personalization);
}catch(Exception $e){
    print '<h3>An exception occurred:</h3>';
    var_dump($e);
}

echo $result_sign->{'embeddedWidgetCreationResult'}->javascript;

and the result from console is, after the ajax call the echosign file and i check the frontend what was inserted, i see the script that is trying to call the iframe for the widget and is coming that error failed to write document.

To work correctly it have to display the script and the iframe, but with me after script is stopping with that error.

Thanking in advance for any help.

Fabian N.
  • 3,570
  • 2
  • 20
  • 44
aaa
  • 330
  • 1
  • 5
  • 24
  • Consider adding more information of what you have tried and where you checked for possible errors. – Chris Jul 23 '14 at 12:18
  • Please see my updated question, i put the code as well. Thanks you @Chris – aaa Jul 23 '14 at 12:29

1 Answers1

1

I found the solution, if someone have similar problems with document.write you just have to load your file into iframe and everything will be good.

Thanks.

aaa
  • 330
  • 1
  • 5
  • 24