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

<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개

혀니천사 님, 암것도 안 올라 오네요. ^^;
댓글을 작성하시려면 로그인이 필요합니다. 로그인

개발자팁

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

+
분류 제목 글쓴이 날짜 조회
PHP 10년 전 조회 2,363
PHP 10년 전 조회 2,616
PHP 10년 전 조회 2,483
MySQL 10년 전 조회 3,855
MySQL 10년 전 조회 2,612
MySQL 10년 전 조회 2,836
PHP 10년 전 조회 2,295
PHP 10년 전 조회 2,695
PHP 10년 전 조회 3,673
웹서버 10년 전 조회 2,759
PHP 10년 전 조회 7,099
OS 10년 전 조회 3,757
OS 10년 전 조회 2,911
웹서버 10년 전 조회 3,876
PHP 10년 전 조회 7,354
jQuery 10년 전 조회 4,033
기타 10년 전 조회 2,546
기타 10년 전 조회 2,806
기타 10년 전 조회 2,625
기타 10년 전 조회 2,822
기타 10년 전 조회 3,099
기타 10년 전 조회 2,958
MySQL 10년 전 조회 5,794
MySQL 10년 전 조회 4,459
jQuery 10년 전 조회 3,257
웹서버 10년 전 조회 4,516
MySQL 10년 전 조회 2,749
기타 10년 전 조회 2,780
웹서버 10년 전 조회 3,323
웹서버 10년 전 조회 2,798
🐛 버그신고