A call to document.write() from an asynchronously-loaded external script was ignored.

  • dmcprofilevideos
    Asked on July 17, 2014 at 12:01 AM

    Greetings,

    I am loading jotform via jQuery  getScript function:

     

    $.getScript('scripts/multiple_view/one_view.js', function() { console.debug('Script loaded.'); }); $.ajaxSetup({async: false}); $.getScript('http://form.jotform.us/jsform/40844902974159', function() { console.debug('Script loaded.'); }); $.ajaxSetup({async: true});

     

    However when I do this I get the following error.

     

    A call to document.write() from an asynchronously-loaded external script was ignored. and
    TypeError: obj is null Ultimately the jotform does not load on the page.

    Select the url below and select "On Site Employer Profiles" to recreate the error. The error will show in the console.

    Jotform Thread 404571 Screenshot
  • jonathan
    Replied on July 17, 2014 at 7:59 AM

    Hi,

    I think the error was due to the URL parameter value on the getScript method which requires the URL to be the source js file -- not the form URL.

    Can you confirm if this is similar to what you were trying to do

    http://www.tutorialspoint.com/jquery/ajax-jquery-getscript.htm

    Please update us with more details so I can also request assistance from colleague who are more proficient to jquery programming.

     

    Thanks.

     

  • jonathan
    Replied on July 17, 2014 at 8:02 AM

    Btw, I also suggest looking at the JotForm API documentation as it can be helpful also in the script functionality that you were trying to do.

    You can check the GET form script here.

    Thanks.

  • dmcprofilevideos
    Replied on July 17, 2014 at 3:07 PM

    Thanks, I fixed this by using an iframe.

  • David JotForm Support
    Replied on July 17, 2014 at 4:10 PM

    Hi,

    Glad to hear it!  Please let us know if you have any other questions and we will be happy to help.

    Thank you for using Jotform!