|
|
|
jQuery.post() ส่งค่าไปที่ Server ไม่ได้แล้วหรอครับ |
|
|
|
|
|
|
|
deprecate funtion(data) 3.+
ให้ใช้ .done(function)
Code (JavaScript)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
$("#btnSend").click(function () {
$.post( "test_2.php", {data: "xxx"})
.done(function(data){
alert(data);
window.location.href = "test_2.php"
});
});
});
</script>
<input type="button" id="btnSend" value="SEND">
|
|
|
|
|
Date :
2017-12-21 19:27:47 |
By :
Chaidhanan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
งั้นใช้นี่ดีกว่า
Code (PHP)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
$("#btnSend").click(function () {
$.ajax({ url: "test_2.php", type: 'POST',data: {data: "xxx"})
.done(function(data){
alert(data);
window.location.href = "test_2.php"
});
});
});
</script>
<input type="button" id="btnSend" value="SEND">
|
|
|
|
|
Date :
2017-12-21 20:51:57 |
By :
Chaidhanan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|