FormÀ¸·Î â ¿­±âGo to formPage

½ÇÇà Çϱâ
form¿¡¼­ ÀÔ·ÂÇÑ °ªÀÌ submitµÇ¸é, Ư¼ö ¹®ÀÚ¸¦ ó¸®Çϱâ À§ÇØ ÀÚµ¿À¸·Î escape()·Î º¯È¯µÇ°í, action=¿¡ ÁöÁ¤µÈ URL¿¡ form elementÀÇ °ªÀÌ ?name=value·Î ´õÇØÁ®¼­ target¿¡ ÁöÁ¤µÈ ÆäÀÌÁö¿¡ Ãâ·Â(load)µË´Ï´Ù. ÀÌ ¹°À½Ç¥ºÎÅÍ URLÀÇ ³¡±îÁö¸¦ ÀÐÀ¸¸é µË´Ï´Ù. À̰ÍÀ» search¶ó°í ÇÕ´Ï´Ù. var search = self.location.search // search = "?name=value"; ·Î µË´Ï´Ù. ±×¸®°í newWin.htm¿¡¼­ search¸¦ ÀÐÀ»·Á¸é unescape(search)ÇÏ¸é µË´Ï´Ù. ---------------------------------------------------------------------------------------------- <html> <head> <script language="JavaScript"> function newuser() { var search = self.location.search; newWin = eval( 'window.open("newWin.htm' + search + '","windows","width=550,height=200")' ); } </script> </head> <body onLoad="if(self.location.search) newuser()"> <center> <form name="fo"> <input name="txt" type=text value=""> <input type=submit value="NEW USER"> </form> </center> </html> newWin.htm¿¡¼­.. ----------------- <html> <head> <script language="JavaScript"> search = self.location.search.substring(1); value = unescape(search); value = value.substring((value.indexOf("=")+1)); print = '' + '<center><br><hr><h1>' + value + '</h1><hr></center>' document.write(print); </script> </head> <body> </body> </html> ----------------------------------------------------------------------------------------------


TOP