I research on google before post on Stackoverflow,, But all problem that i have found are different then my problem.
I am Developing Chrome Extension and load JS from JS...
I am placing an ad script into HTML head..
if i write a script manually in HTML head
<script src="Ads_URL"></script>
Its Working ads show..
. But if i append script throung Jquery or Pure javascript its return Warning
$("head").append("Google Analythic Script"); // Working
$("head").append("<script src="Ads_URL"></script>");//Return warning
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.
Any solution?
Update
This question is not duplicate.. Link in first comment is not helpful for me..
In that question @jfriend00 is using document.write("<span>");
If i use document.write() function, Ads show, but remove all tags from body and just <script> is left "document.write() Clear the body"
Here is my script that i want to inject
<script data-cfasync=false src='//s.ato.mx/p.js#id=21352&size=300x250'></script>