0

I'm very new to API's and Javascript/JQuery and I'm using this tutorial to gather listings to build a custom website for an Etsy shop.

When a product is clicked, this code will load the product page on etsy itself but I'd like to load a product page on my website if possible and I have no idea how. I think it would use .onclick or .load but I only know how to implement this for a static page. I don't know how to implement this when I need to call dynamic content depending on the product/listing id that was clicked.

I'm much more of a designer not developer! Thank you in advance

EDIT: I have my products showing but I am now stuck as to how to edit this (line 21 on the tutorial) to open a dynamic page that loads the specific product details rather than opening the product page on etsy

for (i = 0; i < resp.results.length; i++) {
                if (resp.results[i].shop_section_id === shopSectionID) {
                    //don't show prices:
                    //$("#" + shopSectionID).append('<div style="display: inline-block"><a target="_blank" href="' + resp.results[i].url + '">' + '<img class="pullImg" style="padding:' + imgPadding + '" src="' + resp.results[i].MainImage.url_170x135 + '"</img></a></div>');
                    //show prices:
                    $("#" + shopSectionID).append('<div style="display: inline-block"><a target="_blank" href="' + resp.results[i].url + '">' + '<img class="pullImg" style="padding-top:' + imgPadding + ';padding-left:' + imgPadding + ';padding-right' + imgPadding + '" alt="' + resp.results[i].description + '" src="' + resp.results[i].MainImage.url_170x135 + '"></img></a><center>$' + resp.results[i].price.slice(0, -3) + '</div>');

                }

EDIT 2 - To clarify further: Rather than load the result’s url in the href id like it to create a new product page that will load the image, title, description etc. What JQuery do I need to replace this snippet with to load/create a new dynamic page

<a target="_blank" href="' + resp.results[i].url + '">'
  • That's a rather long tutorial, let us know where you are so we can better assist. – Phillip Thomas Feb 06 '18 at 21:42
  • Hi @PhillipThomas, apologies I hope my edit above explains a little better? I'm have completed the tutorial but would like to go further with it to create the website I'd like – Marissa Silver Feb 06 '18 at 21:49

0 Answers0