Skip to Main Content
Amazon Hacks
book

Amazon Hacks

by Paul Bausch
August 2003
Intermediate to advanced content levelIntermediate to advanced
304 pages
7h 33m
English
O'Reilly Media, Inc.
Content preview from Amazon Hacks

Add Pop-up Amazon Reviews to Your Web Site

With a few lines of JavaScript, you can add Amazon customer reviews to your web site.

The Amazon pop-up review service is a simple yet powerful way to integrate your site with Amazon. It allows anyone with a web site to generate dynamic customer reviews without needing to know anything about Amazon’s API (see Chapter 6). An independent developer has provided this service to anyone who would like to use it.

All you need to set up the service on your site is a product’s ASIN [Hack #1]. When a visitor clicks the pop-up review link, the application receives the ASIN, connects to Amazon’s API, downloads the specific XML data, and parses through it to build the product page with reviews. The data is then displayed on a stylized web page in a new browser window.

The Code

Displaying the generated code in a pop-up window takes just two easy steps. First, create a new HTML page and paste the following JavaScript between the <head></head> tags. This code creates a function called AmazonLookup that will control the state of the pop-up window and initiate a link to the remote server.

<script type="text/javascript"> function AmazonLookUp(ASIN) { // Set pop-up window properties var winoptions = 'toolbar=no,'; winoptions += 'menubar=no,'; winoptions += 'location=no,'; winoptions += 'scrollbars=yes,'; winoptions += 'resizable=yes,'; winoptions += 'statusbar=yes,'; winoptions += 'width=470,'; winoptions += 'height=500'; //Set the remote service URL, including ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

From ChatGPT to HackGPT: Meeting the Cybersecurity Threat of Generative AI

From ChatGPT to HackGPT: Meeting the Cybersecurity Threat of Generative AI

Karen Renaud, Merrill Warkentin, George Westerman
Incident Metrics in SRE

Incident Metrics in SRE

Stepan Davidovic

Publisher Resources

ISBN: 0596005423Supplemental ContentCatalog PageErrata