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. 26
    Oct 2010
    16:26

    여호와의 증인의 신앙

    Category유용한상식 Views7467
    Read More
  2. 26
    Oct 2010
    12:58

    인터넷 광랜 위약금 없이 해지하는 방법

    Category유용한상식 Views16995
    Read More
  3. 25
    Oct 2010
    18:18

    레지스트리 팁 - 로그오프하지 않고 반영하기

    Category컴퓨터잡담 Views5297
    Read More
  4. 11
    Oct 2010
    17:32

    Autohotkey 파일 저장시 한글 깨짐 현상

    Category컴퓨터잡담 Views11170
    Read More
  5. 11
    Oct 2010
    00:05

    javascript만으로 폼전송

    Category컴퓨터잡담 Views13313
    Read More
  6. 10
    Oct 2010
    23:51

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

    Category컴퓨터잡담 Views18961
    Read More
  7. 10
    Oct 2010
    23:49

    자바스크립트로 전송(submit) 버튼 누르기

    Category컴퓨터잡담 Views103644
    Read More
  8. 09
    Oct 2010
    12:54

    [엑셀] SUMPRODUCT 함수 이용, 조건에 따른 중복항목 제외 후 카운트하는 함수

    Category컴퓨터잡담 Views14579
    Read More
  9. 04
    Oct 2010
    08:25

    [엑셀] 와일드카드 문자의 변환처리 방법

    Category컴퓨터잡담 Views10960
    Read More
  10. 02
    Oct 2010
    13:31

    레지스트리 컨트롤로 XP의 가상메모리 페이징 파일의 강제 자동설정을 끌 수 있는 방법

    Category컴퓨터잡담 Views9075
    Read More
Board Pagination Prev 1 ... 196 197 198 199 200 ... 235 Next
/ 235

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소