Skip to content

Cannot reload AD by clearing and recreating new AD div #138

@AlanLoyc

Description

@AlanLoyc

Hi,

In my page my AD is loaded normally upon entering, but when I try to reload it, sometimes it will fail and the AD cannot be displayed. I reload with the following script:


function reloadAD() {
    $('#output').html('<div class="adunit" data-adunit="'+adunitID+'" data-dimensions="'+dimensions+'">Ad could not be loaded.</div>');
    $.dfp(networkID);
}

And the script is triggered by a button I inserted as simply as:
<button type="button" onclick="reloadAD()">Reload AD</button>

I inserted the code segments above into the test page cloned from: http://coop182.github.io/jquery.dfp.js/dfptests/test.html?google_console=1&networkID=15572793&adunitID=Leader&dimensions=728x90

It loads without problem through loading it with pressing the "Submit" button, but as I inserted the code above, loads the AD with "Submit", and then reload it with the "Reload AD" button, it will fail after certain tries.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions