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
번호 분류 제목 날짜 조회 수
497 [Docs]스프레드시트 구글 스프레드시트 설문지 내맘대로 수정하기 file 2016.08.13 11654
496 [Docs]스프레드시트 구글 스프레드시트 ajax POST를 통한 기록 따라해보기 file 2018.01.13 6704
495 컴퓨터잡담 구글 문서도구 스프레드시트로 바코드 입력하기 2014.07.19 4667
494 [Docs]스프레드시트 구글 드라이브에서 다른 파일 데이터 참조하기 file 2016.08.06 6360
493 WindowsTip 공유기의 공인IP(Wan) 미할당으로 안되는 증상이 잦은경우 대처방법 file 2015.01.22 1968
492 컴퓨터잡담 공유기에서 여러명이 mstsc 원격제어 사용하는 방법 2 2011.12.07 7013
491 컴퓨터잡담 공유기가 자꾸 다운되는 현상에 대한 여러가지 해결방법 2 2012.11.05 5038
490 컴퓨터잡담 공유기 종류별 웹로그인 방법 1 2013.03.19 13818
489 컴퓨터잡담 공룡 색칠공부 file 2012.10.29 4492
488 컴퓨터잡담 경량 태양광 충전기 2012.05.13 4186
487 Visual C++ 객체지향 2 2011.01.29 23844
486 WindowsTip 강력한 백신 avast file 2012.08.07 6982
485 WindowsTip 가상메모리 클리어로 빠른 부팅하기 12 file 2012.11.23 14948
484 컴퓨터잡담 [해킹차단]이런창이 뜨는 사이트들 정말 조심하길 바란다. 3 file 2010.05.04 22036
483 컴퓨터잡담 [파이썬] 설치 및 사용방법 file 2021.03.12 1861
482 컴퓨터잡담 [팁&테크] 하드디스크 파티션 숨기기 2 2009.12.08 13494
481 컴퓨터잡담 [크롬] 원격 데스크톱 외부접속시 "서버에서 참조를 반환했습니다." 오류 해결법 2019.11.18 11516
480 컴퓨터잡담 [크롬OS] 한글 입력방법 2011.07.27 5312
479 컴퓨터잡담 [충격 ] PHP는 Win32 플랫폼의 COM과 DCOM 객체에 접근할수 있습니다. 2010.11.15 10336
478 컴퓨터잡담 [잦은오류해결] 오류발생을 알려주는 drwtsn32.exe 때문에 다운? 차라리 없애버리자. 2010.08.12 5838
Board Pagination Prev 1 ... 20 21 22 23 24 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소