Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="results" method="post" style="float:left;" name="results" onchange="function">
- </div>
- <script type="text/javascript">
- /* <![CDATA[ */
- function _cb_findItemsByKeywords(root) {
- var items = root && root.findItemsByKeywordsResponse &&
- root.findItemsByKeywordsResponse[0] &&
- root.findItemsByKeywordsResponse[0].searchResult &&
- root.findItemsByKeywordsResponse[0].searchResult[0] &&
- root.findItemsByKeywordsResponse[0].searchResult[0].item || [];
- var html = [];
- html.push('<table width="100%" border="0" cellspacing="0" cellpadding="3"><tbody>');
- for (var i = 0; i < items.length; ++i) {
- var item = items[i];
- var shippingInfo = item.shippingInfo && item.shippingInfo[0] || {};
- var sellingStatus = item.sellingStatus && item.sellingStatus[0] || {};
- var listingInfo = item.listingInfo && item.listingInfo[0] || {};
- var title = item.title;
- var subtitle = item.subtitle || '';
- var pic = item.galleryURL;
- var viewitem = item.viewItemURL;
- var currentPrice = sellingStatus.currentPrice && sellingStatus.currentPrice[0] || {};
- var displayPrice = currentPrice['__value__'] + '€';
- var buyItNowAvailable = listingInfo.buyItNowAvailable && listingInfo.buyItNowAvailable[0] === 'true';
- var freeShipping = shippingInfo.shippingType && shippingInfo.shippingType[0] === 'Free';
- if (null !== title && null !== viewitem) {
- html.push(`
- <tr>
- <td class="image-container">
- <img src="${pic}"border = "0">
- <\/td>
- <td class="data-container">
- <a class="item-link" href="${viewitem}" target="_blank">
- <p class="title">${title}<\/p>
- <p class="subtitle">${subtitle}<\/p>
- <p class="price">${displayPrice}<\/p>
- ${buyItNowAvailable ? '<p class="bin">Sofort Kaufen<\/p>' : ''}
- ${freeShipping ? '<p class="fs">Versandkostenfrei<\/p>' : ''}
- <\/a>
- <\/td>
- <\/tr>
- `);
- }
- }
- html.push('<\/tbody><\/table>');
- document.getElementById("results").innerHTML = html.join('');
- }
- /*]]>*/
- </script>
- <script src=
- "https://svcs.ebay.com/services/search/FindingService/v1?SECURITY-APPNAME=BAFTunin-DFuchs-PRD-9796ade31-eb6822af&OPERATION-NAME=findItemsByKeywords&SERVICE-VERSION=1.0.0&RESPONSE-DATA-FORMAT=JSON&callback=_cb_findItemsByKeywords&REST-PAYLOAD&keywords=Alufelge%20Alfa%20Romeo%204C%20Alufelge&paginationInput.entriesPerPage=8&GLOBAL-ID=EBAY-DE&siteid=77"></script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement