- Ajax 提交
<form action="" id="formtest" method="post" onsubmit="return false">
<div><textarea name="message" placeholder="请输入留言内容,我们会尽快与您联系!"></textarea></div>
<div style="display:none;"><input name="captcha_key" id="key" value=""/></div>
<div style="display:none;"><input name="source_page" id="page" value=""/></div>
<div><label>姓名:</label><input type="text" name="name" placeholder="请输入姓名!" /></div>
<div><label>电话:</label><input type="number" name="phone" placeholder="请输入电话!"/></div>
<div><img id="image" src=""/><input type="text" name="captcha" placeholder="请输入验证码" /> </div>
</form>
<div><button type="button" onclick="login()">提交</button></div>
function login() {
$.ajax({
url: url_link + 'api/customer/clue',
type: "POST",
data: $('#formtest').serialize(),
dataType: 'text',
success: function (data) {
console.log(data.message)
}
})
}