JavaScript number-to-string conversion
a = a+'' // This converts a to string
b += '' // This converts b to string
簡單又有用的作法....= =
2008/04/22
2008/04/16
javascript : How to call opener function & set opener element ?
Opener window : openerwindow.html
New window : newwindow.html
<!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=big5" />
<title>Opener window</title>
</head>
<script type="text/javascript" language="javascript">
function OpenNewWindow()
{
window.open("newwindow.html");
}
function CallMe()
{
alert("hello!");
}
</script>
<body>
<form action="#" method="post" name="form1">
<a id="clickme" href="#" onclick="OpenNewWindow();">Click me !</a>
<br />
<input name="textbox1" type="text" value="" />
</form>
</body>
</html>
New window : newwindow.html
<!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=big5" />
<title>New window</title>
</head>
<script type="text/javascript" language="javascript">
function CallOpenerFunction()
{
if (!window.opener.closed)
{
// call opener function
window.opener.CallMe();
}
}
function SetOpenerElement()
{
if (!window.opener.closed)
{
// set opener element
var tf = opener.document.forms[0];
tf.textbox1.value = "hi!";
}
}
</script>
<body>
<a href="#" onclick="CallOpenerFunction();">call opener function</a>
<br />
<a href="#" onclick="SetOpenerElement();">set opener element</a>
</body>
</html>
訂閱:
文章 (Atom)
-
一個糖果有一個糖果紙 一個糖果1元 現在商店在作促銷 3個糖果紙可以換1個糖果 請問 15元最多可以吃幾個糖果?
-
簡單整理一下今天看到的這篇文章, 未來可以用指標來改善團隊狀況。 ----- 軟體工程的重要的指標 DORA 指標 (DevOps Research Assessment) 1. 部署頻率: 產品多快發佈出去 2. 投入到交貨的時間 (Lead-Time For Ch...
-
在預設的情況下,中文的SQL Server的定序設定為Chinese_Taiwan_Stroke_CI_AS, 會把全形及半形視為相同字元,這會影響到我們在SUBSTRING及CARINDEX上的判斷,如果字串內同時有全形及半形的符號,SQL Server皆會把它視為相同的符號....