Amazon product previews problem

Discussion in 'Javascript' started by Ben Straub, Jan 15, 2007.

  1. Ben Straub

    Ben Straub Guest

    Hello. The Intargoogle has failed me, and I'm hoping for some guru
    insight. I'm not sure if these are the right places to post this, but
    here goes.

    I'm writing a small wishlist application in Rails, and I'm trying to
    incorporate Amazon Product Previews (see the demo here if you don't
    know what this is: http://www.tictap.com/tca). I'm able to recognize
    amazon product links (the regex isn't too hard) and insert my
    referrer-id, but the script-include that Product Previews is generating
    a raft of requests to my mongrel server. Here's the snippet I inserted
    just before the </body> tag on all my pages (as per the amazon
    documentation):

    ---------------------------------------------
    <script type="text/javascript"
    src="http://www.assoc-amazon.com/s/link-enhancer?tag=mytag-20">
    </script>
    <noscript>
    <img src="http://www.assoc-amazon.com/s/noscript?tag=mytag-20"
    alt="" />
    </noscript>
    ---------------------------------------------

    Looking at my log, I see lots of lines like this:

    ---------------------------------------------
    Processing PeopleController#function (property) { var results = [];
    this.each(function (value, index) {results.push(value[property]);});
    return results;}
    (for 127.0.0.1 at 2007-01-12 08:54:36) [GET]
    Session ID: 460f7da5266f6c1e87653c2ddf903023
    Parameters: {"action"=>"function (property) { var results = [];
    this.each(function (value, index) results.push(value[property]);});
    return results;}", "controller"=>"people"}
    ---------------------------------------------

    This indicates that the browser is sending a GET for a javascript
    anonymous function declaration to my server. WTF? Oh, and I've tried
    serving a static HTML page with Apache with the same script-include,
    and my log doesn't show the dozens of "function ..." requests.

    Any ideas? I can try to recognize the requests and simply deny them,
    but that still leaves the browser waiting for 80-some round trips to
    the server before the page is finished loading.

    Thanks in advance,

    -- Ben
     
    Ben Straub, Jan 15, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus Gronotte
    Replies:
    6
    Views:
    449
    fitwell
    Nov 2, 2003
  2. Replies:
    8
    Views:
    376
    Toby Inkster
    Jan 18, 2007
  3. padma
    Replies:
    0
    Views:
    374
    padma
    Oct 3, 2007
  4. Replies:
    4
    Views:
    360
    Phrogz
    Nov 2, 2007
  5. Jonathan Rochkind

    Amazon Product API hmac signature?

    Jonathan Rochkind, May 11, 2009, in forum: Ruby
    Replies:
    3
    Views:
    138
    Jonathan Rochkind
    Sep 1, 2009
Loading...

Share This Page