Skip to content
컴퓨터잡담
2010.10.10 23:51

[javascript_tip]자바스크립트 값 넘기기

조회 수 18961 추천 수 0 댓글 2
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

[javascript_tip]자바스크립트 값 넘기기


자바스크립트 값 넘기기 여러버전...ㅋ

아주 기초인데도 가끔씩 헷갈리거나 생각이 안날 때 유용하게 쓰일듯! ㅋ

맞는지는 테스트 안해봄~ 대충보니 맞는 거 같기도 하고.

 

-----------------------열린창에 값넘기기(부모창) 

function push() {  
              window.opener.form.x.value =real_x+mapx; 
              window.opener.form.y.value =real_y+mapy; 
              window.opener.form.x1.value=x1; 
              window.opener.form.x2.value=x2; 
              window.opener.form.x3.value=x3; 
              window.opener.form.y1.value=y1; 
              window.opener.form.y2.value=y2; 
              window.opener.form.y3.value=y3; 

             window.close();    



-----------------------링크 클릭값 넘기기 
function delete1(value){ 

       form.no.value=value; 
       document.form.action= "./basket_delete.php"; 
       document.form.submit(); 


<a href="# class=text1 onclick=delete1(value); value=$row[no]>클릭</a> 


-----------------------form값을 2개 이상 페이지로 전송할경우 
<input type=button value="등록" 
onclick="action='./login1.php';submit();"> 


-----------------------버튼클릭시 값을 줄경우 
<input type=button value수정" onclick="javascript:location.href='./login.php?mode=input&mode2=hahaha"> 



-----------------------자바스크립으로 전송버튼 누르는경우 
function zipchange1(){ 
              document.form.action= "./login.php"; 
                     document.form.submit(); 


-----------------------값전송하기 
<script> 
function a(){ 
bbb="kim"; 
ccc="kim2"; 
ddd="kim3"; 
 location.href ="test1.htm?Bcode="+bbb+"&Ccode="+ccc; 
 } 
</script> 

<input type=button value=클릭 onclick="a();">


-----------------------타겟으로 값을 넘길경우1 
function itemchange4(){ 
document.form.item4.options[form.item4.selectedIndex].value; 
                     document.form.action= "./top.php"; 
                                document.form.target= "top";            //타켓사용 
                     document.form.submit(); 


-----------------------타겟으로 값을 넘길경우2 
<form method="get" name="form" target="xxxx"> 


-----------------------부모창 리로드 값 넘길경우 ㅋㅋ --+(새로고침하기) 
<script> 
//window.opener.location.reload(); 
opener.parent.location.reload(); 
window.close(); 
</script> 

-----------------------프레임 나눌경우 값주기

<frameset> 
<frame src="top.html?receive=$receive> 
... 
</frameset> 



----------------------걍~ 값넘겨줄때 

<script> 
location.href='abc.php?a=1&b=1&c=<?=1?>'; 
</script>

 


셀렉트값은? 


document.form.item1.options[form.item1.selectedIndex].value; 

-----------------------연린창에 값넘기기(부모창) 

function push() { 
window.opener.form.x.value =real_x+mapx; 
window.opener.form.y.value =real_y+mapy; 
window.opener.form.x1.value=x1; 
window.opener.form.x2.value=x2; 
window.opener.form.x3.value=x3; 
window.opener.form.y1.value=y1; 
window.opener.form.y2.value=y2; 
window.opener.form.y3.value=y3; 

window.close(); 



-----------------------링크 클릭값 넘기기 
function delete1(value){ 
form.no.value=value; 
document.form.action= "./basket_delete.php"; 
document.form.submit(); 


<a href="# class=text1 onclick=delete1(value); value=$row[no]>클릭</a> 


-----------------------form값을 2개 이상 페이지로 전송할경우 
<input type=button value="등록" 
onclick="action='./login1.php';submit();"> 


-----------------------버튼클릭시 값을 줄경우 
<input type=button value수정" onclick="javascript:location.href='./login.php?mode=input&mode2=hahaha"> 



-----------------------자바스크립으로 전송버튼 누르는경우 
function zipchange1(){ 
document.form.action= "./login.php"; 
document.form.submit(); 


-----------------------값전송하기 
<script> 
function a(){ 
bbb="kim"; 
ccc="kim2"; 
ddd="kim3"; 
location.href ="test1.htm?Bcode="+bbb+"&Ccode="+ccc; 

</script> 

<input type=button value=클릭 onclick="a();"> 
-----------------------타겟으로 값을 넘길경우1 
function itemchange4(){ 
document.form.item4.options[form.item4.selectedIndex].value; 
document.form.action= "./top.php"; 
document.form.target= "top"; //타켓사용 
documen 
t.form.submit(); 


-----------------------타겟으로 값을 넘길경우2 
<form method="get" name="form" target="xxxx"> 


-----------------------부모창 리로드 값 넘길경우 ㅋㅋ --+(새로고침하기) 
<script> 
//window.opener.location.reload(); 
opener.parent.location.reload(); 
window.close(); 
</script> 

-----------------------프레임 나눌경우 값주기 (확인안해봤는데..;;) 
<frameset> 
<frame src="top.html?receive=$receive> 
... 
</frameset> 



----------------------걍~ 값넘겨줄때 

<script> 
location.href='abc.php?a=1&b=1&c=<?=1?>'; 
</script> 



------------------------- 
자바스크립트 스위치문 
var abc; 
switch(abc){ 
case "": 
구분1 
break; 

default "": 
구문
break; 



로그인 후 댓글쓰기가 가능합니다.

?

List of Articles
번호 분류 제목 날짜 조회 수
757 HTMLPHPMSQL 자주 쓰이는 정규식(Regular Expression) 2018.01.23 10807
756 [Docs]스프레드시트 스프레드시트의 내용이 수정될 경우 즉시 메일발송하는 스크립트 테스트 중 file 2018.01.19 7642
755 AutoHotKey ahk) Send an email 메일발송하기 2018.01.17 9416
754 Excel 독서감상문 EBS교육방송 체험학습 양식 file 2018.01.17 5501
753 [Docs]스프레드시트 구글 스프레드시트 ajax POST를 통한 기록 따라해보기 file 2018.01.13 6681
752 Excel 엑셀 파일을 utf-8 유니코드로 csv 파일로 저장하기 file 2017.12.22 11390
751 Server 초간단 웹서버와 파일서버 프로그램 file 2017.12.12 6291
750 HTMLPHPMSQL mysqli로 DB 검색 조회 2017.11.08 6900
749 컴퓨터잡담 핑테스트(PINGINFOVIEW)와 TCPVIEW file 2017.09.21 2326
748 Server 우린친구블로그 서버 다운해결방법과 MYSQL 실행 안될 때 복구방법 file 2017.06.21 5631
747 Server XE 모바일 default 기본스킨 views 값 나타내기 file 2017.05.06 6795
746 Server 서버 다운시 알람 기능 사용방법(http ping port) file 2017.05.04 10364
745 [Docs]스프레드시트 구글 스프레드시트를 이용한 지메일 예약발송 방법 file 2017.04.30 10790
744 Server 댓글쓰기 - 스케치북 게시판 로그인 사용자만 댓글쓰기 2017.04.05 5159
743 Server FileZilla FTP SERVER 패시브모드 셋팅방법 file 2016.12.22 8782
742 Server ZipperUpper! 애드온 이런것이 있었다니? file 2016.12.14 4606
741 Server PuTTY Download Page(telnet,ftp,ssh) file 2016.12.06 5509
740 Server V2824 User Manual 1 file 2016.12.06 11738
739 Server XE 스케치북 게시판 웹진형에서 사진과 요약글 출력방법 file 2016.12.05 5203
738 Server Server 성능 테스트 secret 2016.11.30 585
Board Pagination Prev 1 ... 7 8 9 10 11 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소