I am adding this file run-time
https://www.google.com/recaptcha/api/challenge?k=6Lesu9wSAAAAAJwEKDbks3whwRlywo-6oFucYU-5
It is giving me error: 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.
here is the code:
$scope.init = function () {
$scope.isPC = utilities.isDesktop();
setTimeout(function () {
signupService.initializeSignup().then(function (response) {
if (response.data != null && response.data.success) {
if (response.data.normalUser.ShowCaptcha != false) {
$.getScript("https://www.google.com/recaptcha/api/challenge?k=6Lesu9wSAAAAAJwEKDbks3whwRlywo-6oFucYU-5").done(function (script, textStatus) {
$rootScope.IsCapcthaScriptAvailable = true;
});
}
}
});
}, 2000);
};
Can anyone tell, how can I add this without getting this error: