Open ajax call using .click function?
At the moment I have a link in a div that targets an ASP page to remove an item from the database.
- <a class="small" href="/products.asp?Action=RemoveProduct&ID=<%=(rsCartItems.Fields.Item("ID").Value)%>">remove</a>
What I could like to do is use JQuery .click and .ajax methods but the only thing I am unsure of is hot to get the ID of the a href tag containing the unique item ID that relates to the db record. Can I use
this.id?
- <script>
- $(document).ready(function(){
- $(".removecartitem").click(function(){
- $.ajax({
- type: "POST",
- url: "/remove.asp?Action=Delete&ID="+this.id,
- success: function(){
- $('#item-list').load('/parts/cartitems.asp');
- }
});
- });
- });
- </script>
- <a class="removecartitem" id="1">remove</a>
- <a class="removecartitem" id="190">remove</a>
Thanks
Simon
$(".btn-slide").click(function(){