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

· 2015-10-15 (목) 22:13:48 · 7673 · 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
혀니천사 님, 암것도 안 올라 오네요. ^^;
댓글을 작성하시려면 로그인이 필요합니다.

개발자팁

5,403건

개발과 관련된 유용한 정보를 공유하세요. 질문은 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
PHP 15-11-05 조회 4,126
PHP 15-11-05 조회 3,024
PHP 15-11-04 조회 2,543
PHP 15-11-04 조회 2,704
PHP 15-11-04 조회 3,113
JavaScript 15-11-04 조회 5,318
PHP 15-11-04 조회 4,071
PHP 15-11-04 조회 3,187
PHP 15-11-03 조회 3,413
MySQL 15-11-03 조회 4,619
MySQL 15-11-02 조회 2,466
PHP 15-11-02 조회 2,922
PHP 15-11-02 조회 2,747
PHP 15-11-02 조회 2,927
PHP 15-10-31 조회 2,811
MySQL 15-10-30 조회 4,214
MySQL 15-10-30 조회 2,940
MySQL 15-10-29 조회 3,173
PHP 15-10-27 조회 2,599
PHP 15-10-23 조회 3,031
PHP 15-10-23 조회 4,028
웹서버 15-10-21 조회 3,104
PHP 15-10-19 조회 7,420
OS 15-10-17 조회 4,067
OS 15-10-17 조회 3,229
웹서버 15-10-17 조회 4,227
PHP 15-10-15 조회 7,674
jQuery 15-10-06 조회 4,388
기타 15-10-05 조회 2,887
기타 15-10-05 조회 3,156