Chapter 2. Distributing and loading your application

 

This chapter covers

  • Configuring your development environment
  • Including scripts on a publisher’s web page
  • Loading supporting JavaScript files and libraries
  • Passing parameters to your third-party script

Let’s pretend you’re the owner of a small but growing e-commerce website. Your online store specializes in the sale of cameras and camera accessories, and carries the playful name of Camera Stork (http://camerastork.com).[1] You’re doing well at attracting business, and you’ve developed a loyal customer base of both professional and amateur photographers. Your website has a bustling review section for each product, where many of your customers have submitted ratings and reviews of their purchases.

1 Sure, laugh it up. Camera-themed domain names are hard to find. This is all they had left!

Some of these customers are so fanatical about your store that they’d love to refer directly to your products from their own blogs and websites. In the past, you’ve handed out referral URLs for publishers to link directly to your products, but the experience is subpar, and you’d like to go further.

2.1. Configuring your environment for third-party development

2.2. Loading the initial script

2.3. The initial script file

2.4. Loading additional files

2.5. Passing script arguments

2.6. Fetching application data

2.7. Summary