Ad directory

HTML5 Guidelines

General Best Practices

  • Optimize loops and timers
  • Minimize DOM access
  • Use Feature detection versus Browser detection for efficiency
  • Do not use ‘eval ()' functions due to security risks
  • Avoid global variables as they may result in naming conflicts and cause code to break
  • Account for syntax differences and requirements between browsers (particularly IE)
  • Request animation frame (use whenever possible as an alternative to set interval)
  • creative should contain code that checks browser support for request animation frame feature
  • setInterval (use as a fallback for older browsers (IE9 and earlier))
  • setInterval is code and computer resource intensive and should be avoided
  • Do not use styles/CSS to change any properties of the native html elements including but not limited to: < html >, < body >, < p >, etc.
  • Please test your ad on the following browsers to ensure that it works as expected across each:
  1. Firefox Mac/PC, most recent version
  2. Chrome Mac/PC, most recent version
  3. Internet Explorer, 10+
  4. Safari, most recent version
  • Ad code should be error-free when testing
  • There should be no errors in the browser’s web development console or web inspector
  • Ad code should be ready to serve live
  • Remove any code that sets clickTAG to another url

Any code for demonstration purposes should be removed, for example:

  1. CSS modifying standard page tags like < body > , < p > , etc
  2. Code that centers ad
  3. Code that colors the page
  • Ad unit(s) should be set to top/left with a zero pixel margin
  • Any console.log calls should be removed or commented out
  • Ad code should be JS Lint compliant
  • Always use JS to set element style to avoid the initial null or zero style value detection or check
  • Initial and sub loads should be within Yahoo specs