Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Sep 21st, 2012  |  syntax: None  |  size: 1.57 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <html>
  2. <head>
  3. <title>eBay Search Results</title>
  4. <style type="text/css">body { font-family: arial,sans-serif;} </style>
  5. </head>
  6. <body>
  7. <h1>eBay Search Results</h1>
  8.  
  9. <script>
  10. // Construct the request
  11. // Replace MyAppID with your Production AppID
  12. var url = "http://svcs.ebay.com/services/search/FindingService/v1";
  13.     url += "?OPERATION-NAME=findItemsByKeywords";
  14.     url += "&SERVICE-VERSION=1.0.0";
  15.     url += "&SECURITY-APPNAME=";
  16.     url += "&GLOBAL-ID=EBAY-US";
  17.     url += "&RESPONSE-DATA-FORMAT=JSON";
  18.     url += "&callback=_cb_findItemsByKeywords";
  19.     url += "&REST-PAYLOAD";
  20.     url += "&keywords=bure";
  21.     url += "&paginationInput.entriesPerPage=3";
  22. </script>
  23.  
  24. <div id="results">
  25. <script>
  26. // Parse the response and build an HTML table to display search results
  27. function _cb_findItemsByKeywords(root) {
  28.  var items = root.findItemsByKeywordsResponse[0].searchResult[0].item || [];
  29.   var html = [];
  30.   html.push('<table width="100%" border="0" cellspacing="0" cellpadding="3"><tbody>');
  31.   for (var i = 0; i < items.length; ++i) {
  32.     var item     = items[i];
  33.     var title    = item.title;
  34.     var pic      = item.galleryURL;
  35.     var viewitem = item.viewItemURL;
  36.     if (null != title && null != viewitem) {
  37.       html.push('<tr><td>' + '<img src="' + pic + '" border="0">' + '</td>' +
  38.       '<td><a href="' + viewitem + '" target="_blank">' + title + '</a></td></tr>');
  39.     }
  40.   }
  41.   html.push('</tbody></table>');
  42.   document.getElementById("results").innerHTML = html.join("");
  43. }  // End _cb_findItemsByKeywords() function
  44. </script>
  45. </div>
  46.  
  47. </body>
  48. </html>