Grow your business by advertising on MSN, Xbox, and more!
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 });
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);
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
Where is the download link?