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
Ïà¹ØÎĵµ£º
×î½üÔÚѧXML£¬¿´ÊéµÄ¹ý³ÌÖÐ˳±ã×öµã±Ê¼Ç£¬¹©ÒÔºó²Î¿¼
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<mce:script language=javascript><!--
var oNodeMap,str,oList,item;
//´´½¨DOMDocument¶ÔÏó
......
replace·½·¨µÄÓï·¨
ÊÇ£ºstringObj.replace(rgExp, replaceText)
ÆäÖÐstringObjÊÇ×Ö·û´®(string)£¬reExp¿ÉÒÔÊÇÕýÔò±í´ïʽ¶ÔÏó(RegExp)Ò²¿ÉÒÔÊÇ×Ö·û´®
(string)£¬replaceTextÊÇÌæ´ú²éÕÒµ½µÄ×Ö·û´®¡£¡£ÎªÁ˰ïÖú´ó¼Ò¸üºÃµÄÀí½â£¬ÏÂÃæ¾Ù¸ö¼òµ¥Àý×Ó˵Ã÷Ò»ÏÂ
<script language="javascript">
var str ......
[ÐÂÎÅ×ÊѶ] ¿ÉÒÔ°ÑjavaScriptǶÈëµ½swfÀïÁË
×ÊѶÀàÐÍ: ·Òë
À´Ô´Ò³Ãæ: http://www.kennybunch.com/blog/2009/09/embedding-javascript-into-a-swf/
×ÊѶԱêÌâ: Embedding JavaScript into a SWF
×ÊѶÔ×÷Õß: Kenny Bunch
flex ¿ª·¢ÕßÓ¦¸Ã¶ÔʹÓÃEmbedÔªÊý¾Ý±êǩǶÈë¸÷ÖÖ×ÊÔ´¶¼ºÜÊìϤÁË£¬ÏÖÔÚÔÚflash cs4ÖÐͬÑù¿ÉÒ ......
·ûºÏ 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" /> ......
<script language="javascript">
function IsDigit(cCheck)
{
return (('0'<=cCheck) && (cCheck<='9'));
}
function IsAlpha(cCheck)
{
return ((('a'<=cCheck) && (cCheck<='z')) || (('A'<=cCheck) && (cCheck<='Z')))
}
function IsaNull(cCheck)
......