Optional SDK Update to Address Problems Experienced When Removing the Ad Container

Microsoft Advertising Blog

Optional SDK Update to Address Problems Experienced When Removing the Ad Container

  • Comments 1

We have noticed that some HTML developers have been impacted by an issue with the Ads SDK when programmatically adding or removing the ad container from the DOM without disposing the Ad control. This may result in the application crashing unexpectedly.

This update of the SDK addresses the issue. If for some reason you are not able to update the SDK, the optional workaround would be

Attaching to existing element:

var adDiv = document.getElementById("myAd");

var adCtrl = new MicrosoftNSJS.Advertising.AdControl(adDiv, { applicationId: 'test_client', adUnitId: 'Image_250x250', isAutoRefreshEnabled: false });

 

Or by adding the container to the DOM before calling the constructor like so:

 

var adDiv = document.createElement("div");

adDiv.id = "myAd";

adDiv.style.width = "250px";

adDiv.style.height = "250px";

document.body.appendChild(adDiv);

var adCtrl = new MicrosoftNSJS.Advertising.AdControl(adDiv, { applicationId: 'test_client', adUnitId: 'Image_250x250', isAutoRefreshEnabled: false });

We are working on our next release with the goal of trying to make the XAML (Z-index) issue even more opaque to developers with our next drop due in the November timeframe.

Cheers

- Ian Ferreira

Follow us on Twitter @MSAdvertising | Find us on Facebook and YouTube | Share your thoughts in the Forums | Subscribe

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Where is the download link?