Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

dispose (JavaScript only) - Windows 8.1

Microsoft Advertising Services

Updated: October 17, 2013

Published: April 1, 2014

You must call this function when you programmatically remove the AdControl from a page. This function will do the required cleanup given there are no event handlers registered.

System_CLiX_note Note

The common scenario is that the JavaScript runtime will handle disposal – most developers will not use this method.

JavaScript only

JavaScript Library: ad.js






  • Type: Boolean

  • Set this value to true to try and have the AdControl remove all event handlers before disposal.

    The default value of this parameter is false.


Attempting to dispose when there are event handlers still registered will throw an exception.

The dispose function will do required cleanup of the AdControl for those users who remove it using code.

Most developers will NOT have reason to remove the AdControl, but if you do, you must call this API beforehand.

System_CLiX_warning Warning

DO NOT remove the remove your div container from the DOM prior to calling dispose.

Support and Feedback

Get product support or report a bug in the advertising SDK by visiting the Windows Store Apps developer support page support page. For product support, under "App development" click the "Advertising SDK" link. To post a question in the support forum, scroll down to "Find answers online" and click "Ads-in-Apps for Windows 8 forum".

Send feedback about this documentation to adsfdbk@microsoft.com. There is no product support through this alias. Documentation feedback only.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.