forked from HANYANG/HANYANG_MES
40 lines
1.2 KiB
PHP
40 lines
1.2 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Document</title>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
</body>
|
|
<script src="/ksvc/inc/jquery.js"></script>
|
|
<script>
|
|
var loada = function () {
|
|
$.ajax({
|
|
url: './1.ajax.php', // 요청 할 주소
|
|
async: true, // false 일 경우 동기 요청으로 변경
|
|
type: 'POST', // GET, PUT
|
|
data: {
|
|
Name: 'ajax',
|
|
Age: '10'
|
|
}, // 전송할 데이터
|
|
dataType: 'text', // xml, json, script, html
|
|
beforeSend: function (jqXHR) { }, // 서버 요청 전 호출 되는 함수 return false; 일 경우 요청 중단
|
|
success: function (jqXHR) {
|
|
console.log('success!!');
|
|
}, // 요청 완료 시
|
|
error: function (jqXHR) {
|
|
console.warn('fail!!');
|
|
}, // 요청 실패.
|
|
complete: function (jqXHR) { } // 요청의 실패, 성공과 상관 없이 완료 될 경우 호출
|
|
});
|
|
}
|
|
|
|
window.setInterval(loada, 1000);
|
|
</script>
|
|
|
|
<`/html> |