Ajax를 사용하여 버튼을 클릭했는지 확인하는 방법은 무엇입니까? 단추를 클릭하면 Ajax 요청 (이미 완료 됨)을 보내고 단추를 클릭하면 알림을 받길 원합니다. 다른 소스 파일에서 눌려 졌는지, Ajax 요청에서 보낼 헤더를 확인하는 방법을 모르겠습니다.Ajax에서 버튼을 클릭했는지 확인
<script type = "text/javascript">
function checkVote()
{
request = new ajaxRequest();
request.open("POST", "checkButton.php", true);
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
request.send(params);
}
function ajaxRequest()
{
try
{
request = new XMLHttpRequest();
}
catch(e1)
{
try
{
request = new ActiveXObject('Msxml2.XMLHTTP');
}
catch(e2)
{
try
{
request = new ActiveXObject('Microsoft.XMLHTTP');
}
catch(e3)
{
request = false;
}
}
}
return request;
}
</script>
내가 말할 수있는 것은 ... 모든 ActiveX ... 제발, 사용하지 마십시오. – Kris
상용구 ajaxRequest isn ' 여기에 필요한 것 같아요. – davidgoli
버튼 클릭 이벤트는 어떻게 시작됩니까? 그것이 내가보고 싶은 것입니다. – davidgoli