Chapter 3. Rendering HTML and CSS

This chapter covers

  • Outputting HTML to the publisher’s page
  • Methods for loading styles
  • Writing conflict-free HTML and CSS
  • Techniques for presenting content using iframes

In the previous chapter, you learned how to load your third-party JavaScript code on the publisher’s page, load supporting JavaScript files, and pass parameters from the publisher’s page to your script. At this point, there’s still nothing to see; your code is executing on the publisher’s page, but you haven’t added a single visual element to the DOM. It’s time to fix that. In this chapter, we’ll cover the steps involved in actually rendering HTML and CSS on the publisher’s page.

Now, not all third-party scripts will make use of rendering. ...

Get Third-Party JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.