87,907
社区成员
发帖
与我相关
我的任务
分享
<script>
check_login();
function check_login() {
$.post("check_mge.php", {scene_id: "1",scene_id2:"2",timeset : "1536485088"}, function(data) {
if (data.msid != null) {
//alert("有数据");
location.href="mem.php";
} else {
setTimeout("check_login()", 5000);
}
}, "json");
}
</script>
<form method="post" name="AddUserForm" action="mem.php">
<textarea name="reply" placeholder="点此回复消息" id="reply" type="text"></textarea>
<input type="button" class="weui-btn weui-btn_mini" value="发送">
</form>
<form method="post" name="AddUserForm" action="mem.php">
<textarea name="reply" placeholder="点此回复消息" id="reply" type="text"></textarea>
<input type="button" class="weui-btn weui-btn_mini" value="发送">
</form>
但form提交会造成页面转跳,影响用户体验,唯有请大神出手啊,谢谢!<script type="text/javascript">
function get(obj) {
if (document.getElementById("customer").value=="") {
alert('请选择联系人');
self.location='liaotianxinxi.php';
return;
}
if (document.getElementById("reply").value=="") {
alert('请输入要发送的消息');
return;
}
obj.disabled = true;
var customer = $("#customer").val();
var reply = $("#reply").val();
$.ajax({
url: "customer.php",
type: "Post",
data: "customer=" + customer + "&reply= "+ reply,
success: function(msg) {
obj.disabled = false;
$("#reply").val('');
alert('已发送\n'+s);
}
})
}
</script>
<textarea name="reply" placeholder="点此回复消息" id="reply" type="text"></textarea>
<input type="submit" value="发送" onClick="get(this)">
<script type="text/javascript">
function get(obj) {
if (document.getElementById("customer").value=="") {
alert('请选择联系人');
self.location='liaotianxinxi.php';
return;
}
if (document.getElementById("reply").value=="") {
alert('请输入要发送的消息');
return;
}
obj.disabled = true;
var customer = $("#customer").val();
var reply = $("#reply").val();
$.ajax({
url: "customer.php",
type: "Post",
data: "customer=" + customer + "&reply= "+ reply,
success: function(msg) {
obj.disabled = false;
$("#reply").val('');
alert('已发送\n'+s);
}
})
}
</script>
<textarea name="reply" placeholder="点此回复消息" id="reply" type="text"></textarea>
<input type="submit" value="发送" onClick="get(this)">
请高手帮看看怎么解决这个冲突,谢谢!
check_login();
function check_login() {
$.post("check_mge.php?time="+new Date().getTime(), {scene_id: "1",scene_id2:"2",timeset : "1536485088"}, function(data) {
if (data.msid != null) {
//alert("有数据");
location.href="mem.php?time="+new Date().getTime();
} else {
setTimeout("check_login()", 5000);
}
}, "json");
}