빠른 문의
if (e.currentTarget.id == "homeForm") {
// alert("asd1f2s1df");
e.preventDefault();
let flag = false;
let protocol = window.location.protocol;
let backpage = protocol + "//" + document.location.hostname + "/inquiryok?back=" + document.location.pathname;
if (emailValid && messageValid) {
flag = true;
}
if (flag) {
$.post(protocol + "//inquiry.digoodcms.com/api/save/hanfengdianzi", $(this).serialize(), function(res, status) {
if (res.indexOf('Inquiry Send Success') >= 0) {
// window.location.href = backpage;
$("#homeForm").hide();
$(".submit-success").show();
}
});
}
}
});
function getTimestamp() {
var d = new Date(),
Y = d.getFullYear(),
M = (d.getMonth() + 1) > 9 ? (d.getMonth() + 1) : '0' + (d.getMonth() + 1),
D = d.getDate() > 9 ? d.getDate() : '0' + d.getDate(),
h = d.getHours() > 9 ? d.getHours() : '0' + d.getHours(),
m = d.getMinutes() > 9 ? d.getMinutes() : '0' + d.getMinutes(),
s = d.getSeconds() > 9 ? d.getSeconds() : '0' + d.getSeconds();
var timestamp = `${Y}/${M}/${D} ${h}:${m}:${s}`;
var rand = Math.random();
rand = rand.toString().substr(3);
return timestamp + ', version=' + rand;
}
if ($('.message-aa338c537a48e08637dd81b6128f7740').length) {
$('.message-aa338c537a48e08637dd81b6128f7740').val('from: ' + window.location.href + ', date: ' + getTimestamp());
}
});