[  ¡Ý location ]     

¢Ñ  Á¤ÀÇ
  1. ÇöÀçÆäÀÌÁö¸¦  ´Ù¸¥ ÆäÀÌÁö·Î À̵¿ ½ÃŲ´Ù.
    href¿Í replace´Â submitÀ» ÇÏÁö ¾Ê¾Æµµ url ÁÖ¼Ò¸¦ ³Ö¾îÁÖ¸é ¹Ù·Î À̵¿ÇÑ´Ù.

¢Ñ  Á¾·ù

 

var url = "http://naver.com?º¯¼ö1=°ª1&º¯¼ö2=°ª2";

1.
self.location.href = url;
2. self.location.
replace(url);

3. opener.location.href = url;
4. opener.location.replace(url);

5. top.location = url;
6.
_parent.window.location = url;
 
7. parent.mainFrame.window.location.href = url;  //parent ÆäÀÌÁö º¯°æ
8. parent.frameName.location.href = url;
9. parent.
layerName.location.href = url;

10. iframeName.location.href = url;                   
 //ifrmae ÀÎ °æ¿ì


¢Ñ self.location.href
    self.location.replace()

 

1. Á¤ÀÇ - href´Â °´Ã¼ÀÇ »óŸ¦ ³ªÅ¸³»´Â ÇÁ·ÎÆÛƼÀÌ´Ù.
           - replace()´Â °´Ã¼ÀÌ µ¿ÀÛÀ» ¸í·ÉÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.

2. Â÷ÀÌÁ¡1 - href´Â ÆäÀÌÁö¸¦ À̵¿½ÃŲ´Ù.
                - replace()´Â ÇöÀç ÆäÀÌÁö¸¦ ¹Ù²ãÁØ´Ù.

   : ±×·¡¼­ href´Â È÷½ºÅ丮¸¦ ³²±âÁö¸¸ replace()´Â È÷½ºÅ丮¸¦ ³²±âÁö ¾Ê´Â´Ù.
     °á±¹ [µÚ·Î°¡±â]¸¦ ´­·¶À» °æ¿ì href´Â ÀÌÀüÆäÀÌÁö·Î À̵¿ÇÏÁö¸¸ replace()´Â µ¹¾Æ°¥ ¼ö ¾ø´Ù.

3. Â÷ÀÌÁ¡2 - replace´Â ij½Ã(ÀÎÅÍ³Ý ÀÓ½ÃÆÄÀÏ)¸¦ ¾²Áö ¾Ê´Â Á¡ÀÌ location.href¿Í ´Ù¸£´Ù.

4. º¸¾È¼º - history¸¦ ³²±âÁö ¾ÊÀ¸¹Ç·Î replace() ´õ ÁÁ´Ù.

¢Ñ  location°ú Anchor tag¿Í ºñ±³

 

1. <a href="ÁÖ¼Ò" target="_top"...>
2. <a href="
ÁÖ¼Ò" target="_self"...>
3. <a href="
ÁÖ¼Ò" target="_parent"...>

¢Ñ  location°ú frame ¿Í ºñ±³

 

1. document.frames["ÇÁ·¹ÀÓ¸í"].location = "http://naver.com";
2. document.frames[
¼ýÀÚ].location = "http://naver.com";

¢Ñ   iframe

  1. iframe¿¡ ´ëÇÑ È£Ãâ ¹æ½ÄÀº iframe °Ô½Ã±Û¿¡¼­ »ó¼¼ ¼³¸íÇϰí ÀÖÀ½.