테스트 사이트 - 개발 중인 베타 버전입니다

ajax 채택완료

주니1 10년 전 조회 4,220

ajax-fom-submit를 구현하고 싶습니다. 아래처럼 했는데 안되네요..

tip이나 예제좀 알려주십시요..

 

 

Name :

 

 

 

 

 

 

댓글을 작성하려면 로그인이 필요합니다.

답변 2개

채택된 답변
+20 포인트
10년 전

매우 많은 옵션이 더 있습니다.

사용방식도 다를 수 구요.

jquery 사이트에서 ajax로 검색하시면 더 많은 내용이 있습니다.

 

</p><p><script></p><p>function set_submit() {</p><p> var data = $("#form").serialize(); // data 항목에서 직접 만들어도 됨</p><p> $.ajax({
  type : "POST", // "GET"가능
  url : "<a href="<a href="http://xxxx.com/update.php" target="_blank" rel="noopener noreferrer">http://xxxx.com/update.php</a>"><a href="http://xxxx.com/update.php" target="_blank" rel="noopener noreferrer">http://xxxx.com/update.php</a></a>", // 상대경로 가능
  async : true, // 비동기방식, false 동기방식 
  cache : false,
  data : data, // param1=aaaa&param2=bbbb 형식
  dataType : "text", // "json", success의 response가 json 오브젝트
  success : function(response, textStatus, xhr) {
   // 결과
   // alert(repsonse);
  },
  error : function(xhr, textStatus) {
   // 에러
   // console.log(xhr.responseText);
   // console.log(textStatus);
  },
  beforeSend : function() { 
   // 발송전 처리
   // 로더시작
  }, complete : function() { 
   // 모두 끝난 후 처리
   // 로더종료
  }
 });</p><p>}</p><p></script></p><p> </p><p><form id="form" name="form" onsubmit="return false">
<input type="text" id="id" name="name" value="value" />

<button type="button" onclick="set_submit()">확인</button>
</form>​</p><p> </p><p>
 

 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

10년 전
ajax=>속에 ajax식으로 ajax도 부모 자식이 성립하나요?
로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

야식금지
10년 전
음...질문내용을 잘 모르겠어요.
$.ajax 안에 또 $.ajax를 쓰는 거라면 안해봐서 모르겠네요.

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인