when we call $.ajax with GET method
$.ajax({
type: "GET",
url: "test.js",
data: "id="+id
});
how to pass data to request file
is above given code is correct for that
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The option to pass data as part of the request is called
data, notdataType.Have a read of the different options you can pass at: http://api.jquery.com/jQuery.ajax/
You can either craft the query/data string yourself, or let jQuery do it by just passing an object.
so your ajax signature should look something like this:
or
should both work