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; 



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

?

  1. 23
    Jun 2011
    12:45

    [TCP/IP] 인터넷 연결 문제 복구 및 확인방법

    Category컴퓨터잡담 Views19855
    Read More
  2. 30
    Jun 2012
    08:14

    PDF, EXCEL 파일 변환

    CategoryExcel Views19809
    Read More
  3. 19
    Sep 2009
    17:49

    [php] 특수문자 -> 엔티티, 엔티티 -> 특수문자

    Category컴퓨터잡담 Views19807
    Read More
  4. 02
    Feb 2013
    08:09

    문서 보안 프로그램 삭제 방법

    Category컴퓨터잡담 Views19677
    Read More
  5. 03
    Dec 2013
    08:11

    탐색기로 ftp 폴더 바로열기

    CategoryWindowsTip Views19666
    Read More
  6. 11
    Feb 2011
    15:33

    Internet Explorer Control

    CategoryAutoHotKey Views19663
    Read More
  7. 13
    Apr 2010
    17:12

    MYSQL Qcache 값 조정~~~

    Category컴퓨터잡담 Views19554
    Read More
  8. 08
    Dec 2009
    11:09

    Windows XP에서 Boot.ini 파일을 편집하는 방법

    Category컴퓨터잡담 Views19534
    Read More
  9. 26
    Nov 2022
    10:31

    Windows용 Tesseract 설치 및 사용법

    Category파이썬 Views19533
    Read More
  10. 11
    Feb 2011
    17:31

    AHK에서 가능한 COM 인터넷 익스플로러 및 GUI 브라우저

    CategoryAutoHotKey Views19502
    Read More
  11. 19
    Dec 2009
    15:15

    [Autohotkey] 인터넷 창을 여러개 띄우고 컨트롤 할때 ahk_id 알아내기

    Category컴퓨터잡담 Views19462
    Read More
  12. 09
    Aug 2009
    13:01

    주식투자, 성공투자 원칙을 지키는 방법

    Category컴퓨터잡담 Views19423
    Read More
  13. 26
    Nov 2022
    10:39

    파이썬 화면 캡쳐하기

    Category파이썬 Views19343
    Read More
  14. 28
    Nov 2011
    08:37

    Spoo1sv.exe 바이러스 치료하기

    Category프로세스 Views19179
    Read More
  15. 16
    Mar 2012
    13:26

    엑셀) 날짜를 요일로 변환하기

    CategoryExcel Views19179
    Read More
  16. 25
    Mar 2023
    12:40

    파이썬으로 captCha 분석하여 웹사이트 소스 가져오기

    Category파이썬 Views19152
    Read More
  17. 30
    Dec 2011
    19:09

    autohotkey) IPv6 모두 사용안함 설정하기

    CategoryAutoHotKey Views19133
    Read More
  18. 21
    Feb 2011
    23:55

    COM 사용

    CategoryAutoHotKey Views19065
    Read More
  19. 16
    Feb 2011
    06:30

    [ahk] 다른 프로그램의 트레이 아이콘을 숨기기

    CategoryAutoHotKey Views19029
    Read More
  20. 10
    Oct 2010
    23:51

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

    Category컴퓨터잡담 Views18961
    Read More
Board Pagination Prev 1 ... 7 8 9 10 11 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소