Hello, how to send ajax Form Data request, image + other text values?
Closed due to the fact that the participants are Igor , Vanya Avchyan , andreymal , Deonis , αλεχολυτ 6 Jun '17 at 8:14 pm .
- Most likely, this question does not correspond to the subject of Stack Overflow in Russian, according to the rules described in the certificate .
- stackoverflow.com/questions/21044798/… - Igor
- 6Welcome to StackOverflow! This question should be closed, because the author was too lazy to type three words in Google. - Igor
- var form = document.querySelector ('. my-form'); var data = new formData (form); and further when forming AJAX xhr.send (data); - pepel_xD
|
1 answer
If you need to send AJAX images, then
var values; // нужные значения сюда (можно с сепаратором $ или &, например) // для отправки изображения юзай .toDataURL(); $.ajax({ type: "POST", url: "http://example.com/?values"+=values, succes: function(data) { // делаем все что хотим если успешно } }); |