0

I am trying to submit a link with an anchor without a page refresh.

I know we can bind them with an id. I tried a lot and nothing works in Shopify as Shopify has their own event handler and every time I tried I didn't get any result.

I tried this and several other answers in Stack Overflow, but nothing works in Shopify. However, they work in plain an HTML and jsfiddle test.

$("a#link").click(function(){

    $.post("mark_auto.php",
       {
         prev_id: $(this).attr("prev_id"),
         next_id: $(this).attr("next_id")
       },
       function(data) {
         alert("Data Loaded: " + data);
       }
    );

    return false;
});

 <a id="link" href="mark_auto.php?id=1" prev_id="5" next_id="45">ooikjhijhj</a>

I tried several other answers but none worked in Shopify.

I have several links and I want to add an anchor next to every one and when users clicks that it will be submitted.

It seems simple as we can bind with an id and stop the default submission and get it done, but it does not work in Shopify.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
turkyoung
  • 11
  • 3

0 Answers0