var hotel = {
UserName: '111111',
Id: id,
Name: $('#hotelName').val(),
Logo: img,
BackgroundColor: $('#backgroundColor').val(),
LangList: [{
Active: $enlang,
LangCode: 'en',
Message: $('#Content-en').html()
}, {
Active: $frlang,
LangCode: 'fr',
Message: $('#Content-fr').html()
}, {
Active: $selang,
LangCode: 'se',
Message: $('#Content-se').html()
}]
};
var _formData = new FormData();
_formData.append("hotel", JSON.stringify(hotel));
var path = $("#showimg").html();
if (repath.length != 0 || id == null) {
_formData.append('ImagePath', document.getElementById("txtImagePath").files[0]);
}
var $url = null;
if (id == null) {
$url = _url;
} else {
$url = _url + "/" + id;
}
$.ajax({
url: $url,
type: 'POST',
cache: false,
data: _formData,
processData: false,
contentType: false
}).done(function (res) {
window.location.reload();
console.log('success,' + res);
}).fail(function (res) {
console.log('fail,' + res);
});
});
Ajax数据添加与更新
最新推荐文章于 2024-04-23 00:29:43 发布