임을 만들려고 노력이 callFunction();
수행하는 기능을 만들려고 노력 함수 실행 기능
내가 시도 AJAX responseText
이 있기 때문에 내가 AJAX
를 사용하여 PHP 파일에서 JS 기능을 실행하기 위해 노력하고있어
<script type="text/javascript"> callFunction(); </script>
그런 일이 존재하지 않는 경우 내가 (GET 메서드를 통해)는 PHP 요청에서
내가 오류를 AJAX와 함수를 호출 할 수있는 방법, 나는 그것이 시도
FUNC 함수
JS AJAX 코드
var emailVal = document.getElementById("email").value;
var passVal = document.getElementById("password").value;
var uVal = document.getElementById("username").value;
var busVar = document.getElementById("businessname").value;
var firstVal = document.getElementById("firstname").value;
var params = "email=" + emailVal + "&password=" + passVal + "&businessname="+busVar + "&username="+uVal+"&firstname="+firstVal;
var url = "business.php";
http = new XMLHttpRequest();
http.open("POST", url, true);
//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.onreadystatechange = function() { //Call a function when the state changes.
if(http.readyState == 4 && http.status == 200) {
console.log(http.responseText);
exececc(http.responseText , null);
}
}
http.send(params);
PHP 아니다 코드
echo '<script type="text/javascript"> callFunction(); </script>';
예! 나는 현재 코드를 추가하고있다 –