From September, Flash will no longer be supported by Chrome. Prepare for the shift towards HTML5 by visiting our Flash to HTML5 help page

Check it out!

Converting DHTML to a mobile HTML5 banner

  • Replace Adform.DHTML.js with mraid.js

    Banners from Mobile category use different serving scripts then regular HTML banners. Adform DHTML used in regular HTML5 banners will not work in Mobile evironment. MRAID is only available on Mobile banners.

    Replace

    <script src="//s1.adform.net/banners/scripts/rmb/Adform.DHTML.js"></script>
    

    with:

    <script src="mraid.js"></script>
    

    For full MRAID specifications please visit http://www.iab.net/mraid.

  • Update ClickTAGs

    Replace

    var banner = document.getElementById('banner');
    clickTAGvalue = dhtml.getVar('clickTAG', 'http://www.example.com'); 
    landingpagetarget = dhtml.getVar('landingPageTarget', '_blank');
    
    banner.onclick = function() {
       window.open(clickTAGvalue,landingpagetarget);
    }

     with:

    var banner = document.getElementById('banner');		
    banner.addEventListener('click', function() {			
       mraid.open(Adform.getClickURL('clickTAG'));		
    });
  • Update Additional Assets workflow

    Replace dhtml.getAsset(1) with Adform.getAsset(1)

    Please find an example here.