My question is related to jQuery Ajax please help me... [Resolved]

Posted by Kumarkrishna184 under jQuery on 3/27/2016 | Points: 10 | Views : 486 | Status : [Member] | Replies : 1
My question is related to jQuery Ajax

1=>
$.ajax({
url:http://localhost/81/api/products",
type:"delete",
data:{"id:$("#prodid").val()},
});

2=>
$.ajax({
url:http://localhost/81/api/products" + $("#prodid").val(),
type:"delete",
});

What is different between both statement related to data passing. Please explain it...

Thanks and Regards,
Krishna Kumar



Responses

Posted by: Rajnilari2015 on: 3/27/2016 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
In the second one you are passing scalar variable(s) while in the first one you are passing the entire parameter in a single array data structure.

--
Thanks & Regards,
RNA Team

Kumarkrishna184, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response