천

로컬에서 자바스크립트 HTML 소스 가져오기

· 2015-10-15 (목) 22:13:48 · 1278 · 1

<html> 

<head> 

<title>::: 노글스 :::</title> 

</head> 

<body> 

<input type=button onClick=chk() value="chk"> 

결과 

 

<script> 

var sHttp = new ActiveXObject("Microsoft.xmlhttp"); 

 

function httpGet(szURL) { 

  sHttp.open("get",szURL,false); 

  sHttp.setRequestHeader( "Content-type:", "application/x-www-form-urlencoded"); 

sHttp.setRequestHeader("Content-Encoding:", "euc-kr"); 

 

 

  sHttp.onreadystatechange = onRetriveComplete; 

  try{ 

  sHttp.send("code=tnt2"); 

  } 

  catch(e) { 

      return ("Not exist"); 

  } 

 

  if (sHttp.status > 200) { 

  return("not exist<br>"); 

  } else 

 

 

  return(sHttp.responseText); 

 

} 

 

function onRetriveComplete() { 

  sHttp.onreadystatechange = noop; //re-entrant gate 

  if (sHttp.readyState == 4) { 

  } 

} 

 

function noop() { 

  return false; 

} 

 

function chk() { 

 

  getData=httpGet("http://www.phpschool.com/bbs2/inc_board.html"); 

 

  document.noglsForm.test.value=getData; 

 

} 

</script> 

 

<form name=noglsForm> 

<textarea name=test rows=200 cols=200></textarea> 

</form> 

</body> 

</html> 


|

댓글 1개

2015-10-21 (수) 16:46:56
혀니천사 님, 암것도 안 올라 오네요. ^^;
댓글을 작성하시려면 로그인이 필요합니다.

팁게시판

6,077건

디자인과 관련된 유용한 정보를 공유하세요. 질문은 상단의 QA에서 해주시기 바랍니다.

+
제목 글쓴이 날짜 조회
15-10-17 조회 719
15-10-15 조회 1,279
15-10-09 조회 1,464
15-10-06 조회 1,209
15-10-05 조회 676
15-10-05 조회 648
15-10-05 조회 642
15-10-04 조회 619
15-10-04 조회 706
15-10-04 조회 839
15-10-03 조회 1,115
15-10-03 조회 595
15-10-02 조회 983
15-10-02 조회 813
15-10-02 조회 666
15-10-01 조회 638
15-10-01 조회 710
15-10-01 조회 633
15-10-01 조회 657
15-10-01 조회 1,006
15-09-30 조회 565
15-09-30 조회 677
15-09-30 조회 844
15-09-30 조회 750
15-09-24 조회 748