I am trying to Update/Insert a New Tag using JQuery/AJAX. The URL found in the Script Tag is one from another Domain (Web Server), over which I have no control. The results provided by the Web Server are returned in an iframe (again, I have no control over the format of the response).

I have tried the following two solutions (Please note that the Click Button is only used for testing purposes).

First Solution:

```js
$(document).ready(function () {
    $("button").click(function () {
        var NewScript = document.createElement('script');
        NewScript.type = 'text/javascript';
        NewScript.src = 'http://www.contactedurl.com/query&callback=?';
        $("#TDiv").append(NewScript);
    });
});

```

Second Solution:

```js
$(document).ready(function () {
    $("button").click(function () {
        var NewScript = document.createElement('script');
        NewScript.type = 'text/javascript';
        NewScript.src = 'http://www.contactedurl.com/query&callback=?';
        var script = document.getElementsByTagName('script')[0];
        script.parentNode.insertBefore(NewScript, script);
    });
});

```

Both of these solutions generate the following warning message, and thus no update is performed:

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

I understand the reason why this message is generated, and why no update is executed, but I wasn’t able to find any work around to this limitation, or an alternative solution.

I was wondering if anyone would know of an alternate solution.

Thank you.