JavascriptÔõôÔÚÁ½¸ö´°ÌåÖ®¼ä´«Öµ
ÔÎÄ£ºÁõÎä|JavascriptÔõôÔÚÁ½¸ö´°ÌåÖ®¼ä´«Öµ
ÖÚËùÖÜÖªwindow.open() º¯Êý¿ÉÒÔÓÃÀ´´ò¿ªÒ»¸öд°¿Ú£¬ÄÇôÈçºÎÔÚ×Ó´°ÌåÖÐÏò¸¸´°Ìå´«ÖµÄØ£¬Æäʵͨ¹ýwindow.opener¼´¿É»ñÈ¡¸¸´°ÌåµÄÒýÓá£
ÈçÎÒÃÇн¨´°ÌåFatherPage.htm:
XML-Code:
<script type="text/javascript">
function OpenChildWindow()
{
window.open('ChildPage.htm');
}
</script>
<input type="text" id="txtInput" />
<input type="button" value="OpenChild" onclick="OpenChildWindow()" />
È»ºóÔÚChildPage.htmÖм´¿Éͨ¹ýwindow.openerÀ´·ÃÎʸ¸´°ÌåÖеÄÔªËØ£º
XML-Code:
<script type="text/javascript">
function SetValue()
{
window.opener.document.getElementById('txtInput').value
=document.getElementById('txtInput').value;
window.close();
}
</script>
<input type="text" id="txtInput" />
<input type="button" value="SetFather" onclick="SetValue()" />
ÆäʵÔÚ´ò¿ª×Ó´°ÌåµÄͬʱ£¬ÎÒÃÇÒ²¿ÉÒÔ¶Ô×Ó´°ÌåµÄÔªËؽøÐи³Öµ£¬ÒòΪwindow.openº¯ÊýͬÑù»á·µ»ØÒ»¸ö×Ó´°ÌåµÄÒýÓã¬Òò´ËFatherPage.htm¿ÉÒÔÐÞ¸ÄΪ£º
XML-Code:
<script type="text/javascript">
function OpenChildWindow()
{
var child = window.open('ChildPage.htm');
child.document.getElementById('txtInput').value
=document.getElementById('txtInput').value;
}
</script>
<input type="text" id="txtInput" />
<input type="button" value="OpenChild" onclick="OpenChildWindow()" />
ͨ¹ýÅжÏ×Ó´°ÌåµÄÒýÓÃÊÇ·ñΪ¿Õ£¬ÎÒÃÇ»¹¿ÉÒÔ¿ØÖÆʹÆäÖ»ÄÜ´ò¿ªÒ»¸ö×Ó´°Ì壺
XML-Code:
<script type="text/javascript">
var child
function OpenChildWindow()
{
if(!child)
child = window.open('ChildPage.htm');
child.document.getElementById('txtInput').value
Ïà¹ØÎĵµ£º
Õâ¸öЧ¹ûÓ¦¸Ã²»ËãʲôϡÆ棬ÍøÉÏÒ²ÓÐÏֳɵĴúÂ룬ÎÒÕâ¸öҲûʲôÌرðµÄµØ·½£¬Ö»ÊÇÒòΪÎÒ×Ô¼ºÐ´µÄ£¬Ò²ËãÊÇΪѧϰDOMºóÒ»¸öÁ·Ï°£»ÔÚIEϲâÊÔͨ¹ý£»
£¨×î½üÓÖдÁËÒ»¸ö£¬µ±È»²»ÔÙÊÇΪÁËÁ·Ï°£»Çë²Î¿´£ºjavascript²Ù×÷xmlÉú³ÉÊ÷Ðβ˵¥£¨Ò»£©ÃèÊö£©
ʵÏÖЧ¹ûÊÇÕâÑùµÄ£º
¶ÁÈ¡XMLÎĵµ£»
²ÉÓõݹéÉú³ÉÎÞÏÞ¼¶µÄÊ÷Ðβ˵¥£»
Äܹ»ÏìÓ ......
public static void Main()
{
WebRequest req = WebRequest.Create("http://blog.csdn.net/xiaofengsheng");
try
& ......
·ûºÏ XHTML 1.0 Transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> ......
innerTextÊÇieµÄ˽ÓÐÊôÐÔ£¬firefoxµÄÀàËÆÊôÐÔΪtextContent£¬Èç¹ûÔÚÍøÒ³ÖÐʹÓÃinnerTextµÄ»°£¬ÐèÒªÓÃÒ»¸öÌõ¼þÅжÏÀ´²é¿´ä¯ÀÀÆ÷Ö§³ÖÄÄÖÖÊôÐÔ¡£ÕâÀïÎÒÃÇ¿ÉÒÔΪfirefox¶¨ÒåÒ»¸öinnerTextʹµÃÔÚÕýÎÄ´úÂëÖÐÖ»ÐèÒªÓÃinnerText¶ø·ÇÒ»¸öº¯Êý£¬¿Éʹ´úÂë±äµÃ¸üÖ±¹Û¼ò½à¡£
var lBrowser = {};
lBrowser.agt = navigator.userAgent.t ......
·½·¨1£º
1function CheckSelect()
2 {
3 var tb = document.getElementById("ctl00_ContentPlaceHolder1_chkYear");
4
5 for(var i=0;i < tb.rows.length;i+ ......