Book Review: Third-Party JavaScript

This post is more than 2 years old.

"Third-Party JavaScript", by Ben Vinegar and Anton Kovalyov is a fascinating deep dive into the practice of building JavaScript-based services to be used by others. If you have ever made use of Google Adsense, Disqus, or even a simple Twitter widget, then you've been a consumer of a third-party JavaScript application.

On the surface, you may think that such a book would have limited appeal. Many of us write JavaScript and many of us may even use such third-party tools, but the percentage of those who need to author such things is probably pretty limited. In my years in web development, I've never had a client ask me for one and I've only built one once. (See this blog entry on a Behance widget I built.)

I cannot stress how wrong I was. While certainly the book does focus in on embedding code in other web sites, the level of detail and coverage of various browser quirks makes this book invaluable to anyone.

Both authors have worked on the Disqus platform, probably the best example there is of third-party JavaScript, and I would have assumed they would have some knowledge of various browser quirks and issues, but my god, I had no idea the level of insanity they had to deal with in terms of supporting multiple browsers.

This book is an incredible way to learn about how the DOM works, how script loading works, and really how the browser works as well. For every problem discussed multiple solutions are covered as well as a deep explanation of why you may choose one particular solution over another.

If you have no plans ever for building a third-party API, this book is still strongly recommended. Hell, the last two chapters alone on performance and debugging are worth the price of the book alone. This is a book I plan on keeping nearby as I feel like I'll be tapping the knowledge inside again and again.

You can read two samples chapters online now: Chapter 1, Chapter 4.

Here is the table of contents:

  1. Introduction to third-party JavaScript
  2. Distributing and loading your application
  3. Rendering HTML and CSS
  4. Communicating with the server
  5. Cross-domain iframe messaging
  6. Authentication and sessions
  7. Security
  8. Developing a third-party JavaScript SDK
  9. Performance
  10. Debugging and testing

Finally, the book site itself:

Raymond Camden's Picture

About Raymond Camden

Raymond is a senior developer evangelist for Adobe. He focuses on document services, JavaScript, and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA

Archived Comments

Comment 1 by Tim Badolato posted on 6/24/2013 at 6:26 PM

Awesome, glad you mentioned this book.

I actually built a premium web app that allows users to embed a widget on their website. At the time I was researching ways to do this I ran across this book which was yet to be released.

I ended up going the iframe route because it looked insane to try to detect jquery on the page then load it and deal with various quirks.

I will definitely be looking in to checking out this book.

Comment 2 by Ben Vinegar posted on 6/25/2013 at 8:11 AM

Hey Raymond - thanks for writing this. I've been searching high and low for some objective feedback since the book was published. It pleases me to know that you found it a good read, and that you found value outside of the book's focus on third-party stuff. Thanks again!

Comment 3 by Raymond Camden posted on 6/25/2013 at 5:19 PM

Glad to, Ben, thanks for reading this.