how to post a formdata object into ajax post call ?
i have a formdata object how do i post it using ajax post ? I tried it this way:
but when i run it in the browser , it will just start an infinite loop, not sure why
- var formData = { name: "ravi", age: "31" }; //Array
- $.ajax({
- url: "./Index ",
- type: "POST",
- data: formData,
- success: function (data, textStatus, jqXHR) {
- $("#div3").html(data);
- //data - response from server
- },
- error: function (jqXHR, textStatus, errorThrown) {
- }
- });