2017-12-15 2 views
0
<script> 
function showHint(str) { 

    if (str.length == 0) { 
     document.getElementById("txtHint").innerHTML = ""; 
     return; 
    } else { 
     var xmlhttp = new XMLHttpRequest(); 
     xmlhttp.onreadystatechange = function() { 
      if (this.readyState == 4 && this.status == 200) { 
       document.getElementById("txtHint").innerHTML = this.responseText; 
      } 
     } 
     xmlhttp.open("GET", "index.php?dispatch=paysrk.paymod?amount="+str, true); 
     alert(+str); 
     xmlhttp.send(); 
    } 
} 
</script> 

여기에 문제가 있다고 생각합니다. 금액이이 아닙니다 .url이 작동하지 않습니다.cscart에서 ajax 사용 방법

의 index.php? 파견 = paysrk.paymod? 양

+0

당신의 str을 출력 무엇처럼해야 & 앞에는해야합니까? –

+0

텍스트 상자의 값입니다. –

답변

0

내가 당신의 문제는 URL 구문에라고 생각합니다.

는 첫 번째 매개 변수는 ?url에 전달하고 다른 모든 매개 변수가 있으므로 GETurl

index.php?dispatch=paysrk.paymod&amount 

xmlhttp.open("GET", "index.php?dispatch=paysrk.paymod&amount="+str, true);