네X트 쪽지 보내기 javascript

terrorboys님의 네이트온 쪽지로 보내기
http://sir.co.kr/bbs/board.php?bo_table=g4_skin_board&wr_id=34470

위 게시물을 참고하였습니다.
네X트 쪽지 보내기 기능을 좀 더 사용하기 쉽게 만들어 보았습니다.
사용하기 전 네X트 로그인 상태여야 합니다.
자세한 내용은 예제파일을 내려받아 살펴보시기 바랍니다.

== 예제1 : sample1.html ========================================================

<script type="text/javascript" src="nMessage.js"></script>
<script type="text/javascript">
var nMsg = new nMessage("수신인 네X트 아이디", "쪽지내용");
nMsg.send(); // 쪽지발송
</script>





== 예제2 : sample2.html ========================================================

<script type="text/javascript" src="nMessage.js"></script>
<script type="text/javascript">
var nMsg = new nMessage("수신인 네X트 아이디", "쪽지내용");
nMsg.setCallbackFunction(callback);
nMsg.send(); // 쪽지발송

function callback(nMsg)
{
     if (nMsg.isCompleted)
          alert("[전송성공]\n\n" + nMsg.getMessage());
     else
          alert("[전송실패]\n\n" + nMsg.getMessage());
}
</script>






== 예제3 : sample3.html ========================================================

<script type="text/javascript" src="nMessage.js"></script>

<form onsubmit="return check();">
<dl>
     <dt>수신인 네X트 아이디</dt>
     <dd><input type="text" name="nReceiver" id="nReceiver" style="width:20%"></dd>
     <dt>쪽지내용</dt>
     <dd><textarea name="nBody" id="nBody" style="width:20%;" rows="10" onkeyup="fc_chk_byte(this, 4000)"></textarea></dd>
</dl>
<input type="button" onclick="check()" value="보내기">
<input type="reset" value="취소">
</form>

<script type="text/javascript">
function check()
{
     // 객체생성
     var nMsg = new nMessage();

     // 쪽지수신인 아이디
     var nReceiver = document.getElementById("nReceiver");

     // 쪽지내용
     var nBody = document.getElementById("nBody");

     nMsg.setReceiver(nReceiver.value);
     nMsg.setBody(nBody.value); 

     nMsg.setCallbackFunction(callback);
     nMsg.send();
     return false;
}

function callback(nMsg)
{
     if (nMsg.isCompleted)
          alert("[전송성공]\n\n" + nMsg.getMessage());
     else
          alert("[전송실패]\n\n" + nMsg.getMessage());
}
</script>



※ 주의 : 본 활용팁 사용과 관련해 발생하는 모든 책임은 사용자에게 있습니다.

첨부파일

nMessage.js (4.4 KB) 62회 2010-10-22 20:46
sample1.html (182 bytes) 61회 2010-10-22 20:46
sample2.html (403 bytes) 4회 2010-10-22 20:46
sample3.html (1.1 KB) 14회 2010-10-22 20:46
|

댓글 6개

오호~
여기 까지는 강제로 못 뽑아 왔는데 감사합니다.
오오 신기하네요 ㅎㅎ
근데 왠지 이거이... 스팸으로 악용될거같다는....ㅠㅠ
사용권한이 없다고 나오는건 저 뿐인가요??
ㅠ.ㅠ
로그인 하셔야 함미다.. 그리고 창 유지... 아님 과자 설정을..
댓글을 작성하시려면 로그인이 필요합니다.

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요. 나누면 즐거움이 커집니다.

+
제목 글쓴이 날짜 조회
15년 전 조회 3,755
15년 전 조회 4,240
15년 전 조회 5,623
15년 전 조회 5,381
15년 전 조회 2,785
15년 전 조회 8,635
15년 전 조회 3,871
15년 전 조회 5,076
15년 전 조회 3,730
15년 전 조회 4,928
15년 전 조회 5,896
15년 전 조회 4,377
15년 전 조회 6,920
15년 전 조회 4,430
15년 전 조회 4,940
15년 전 조회 7,132
15년 전 조회 6,264
15년 전 조회 1.7만
15년 전 조회 4,336
15년 전 조회 1.1만