$('.upload').on('click', function() {
var clickedID = this.id.split("-"); //Разбиваем строку (Split работает аналогично PHP explode)
var DbNumberID = clickedID[1];
var file_data = $('#sortpicture').prop('files')[0];
var form_data = new FormData();
form_data.append('file', file_data);
$.ajax({
url: 'upload.php',
dataType: 'text',
cache: false,
contentType: false,
processData: false,
data: form_data,
type: 'post',
success: function(php_script_response){
alert(form_data,DbNumberID );
}
});
});
$('.upload').on('click', function() {
var clickedID = this.id.split("-"); //Разбиваем строку (Split работает аналогично PHP explode)
var DbNumberID = clickedID[1];
var file_data = $('#sortpicture').prop('files')[0];
var form_data = new FormData();
form_data.append('file', file_data);
form_data.append('DbNumberID', DbNumberID);
$.ajax({
url: 'upload.php',
dataType: 'text',
cache: false,
contentType: false,
processData: false,
data: form_data,
type: 'post',
success: function(php_script_response){
alert(form_data,DbNumberID );
}
});
});
function getData(pageId) {var myRequest = new Request(pageId + '.php', {method: 'POST',headers: { "Content-Type":"application/x-www-form-urlencoded" },
body: 'foo={"name":"'+event.target.id+'","time":"'+pageId+'","name2":"'+$sss+'"} '});
fetch(myRequest).then(function(response) { return response.text() })
.then(function(text) { myArticle.innerHTML = text;