Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

the ol' 'asynchronously-loaded' #381

Open
joergipoergi opened this issue Jan 20, 2017 · 5 comments
Open

the ol' 'asynchronously-loaded' #381

joergipoergi opened this issue Jan 20, 2017 · 5 comments

Comments

@joergipoergi
Copy link

Hi, maybe i'm getting something wrong, or one of my ad providers are.

but using postscribe with this string:

'<script type="text/javascript" src="//www.googletagservices.com/tag/js/gpt.js">
googletag.pubads().definePassback("/53015287/derstandard.at_d_de_300x250_1", [300, 250]).setClickUrl("%%CLICK_URL_UNESC%%").display();
</script>'

yields this 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.

of course i have to say, these guys are trying to implement some form of header-bidding, ie, they call a couple of programmatic-adproviders, let each of them do their own bidding and then choose the best bidder. It's all very complicated and i understand only half of it.

I don't think it's a bug and i actually want the providers (they are called yieldlove) to change their code, but maybe you guys have a better explanation?

I am a developer, so you can talk normal to me. I work for a big austrian newspaper.

@jnewman
Copy link
Contributor

jnewman commented May 11, 2017

Try moving googletag.pubads().definePassback("/53015287/derstandard.at_d_de_300x250_1", [300, 250]).setClickUrl("%%CLICK_URL_UNESC%%").display(); into a separate script tag if possible.

@oller
Copy link

oller commented Nov 1, 2017

Did you get this working in the end @joergipoergi?

I'm hitting the same error when trying to execute the following code after page load.

var tag = `<ins class='dcmads' style='display:inline-block;width:320px;height:50px'
            data-dcm-placement='*id*'
            data-dcm-rendering-mode='iframe'
            data-dcm-https-only
            data-dcm-resettable-device-id=''
            data-dcm-app-id=''>
            <script src='https://www.googletagservices.com/dcm/dcmads.js'></script>
        </ins>`;

        postscribe(newElement, tag, {
            done: function () {
                console.info('ad should be loaded!');
            }
        });

Encountering the same warning thrown from dcmads.js, so it's loading fine then chrome is throwing the same warning as you were getting : 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 insight appreciated @jnewman . Cheers!

@hirohanin
Copy link

Hi any resolutions here

@jnewman
Copy link
Contributor

jnewman commented Dec 21, 2017

@oller can you send me a test page? I'm not able to reproduce this error. A https://plnkr.co would be ideal.

@hirohanin
Copy link

this can be solved using google light passback tag instead of normal gpt tag

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants