javascript开发系列(多框架)
opener.window表示打开它的原框架。
top表示顶部框架,
parent引用包含这个窗口的window对像
例子如下;
a.htm页面
<!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 runat="server">
<title></title>
<script type="text/javascript">
function a(url,w,h) {
var x = window.screen.availWidth/2-w;
var y = window.screen.availHeight/2-h;
var str = "height="+h+",width="+h+",top="+y+",left="+x+",toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no";
window.open(url, "_blank", str);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="atxtName" runat="server" onclick="a('aa.aspx','100','500')"></asp:TextBox>
</div>
</form>
</body>
</html>
aa.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 runat="server">
<title></title>
<script type="text/javascript">
function aa() {
opener.window.document.getElementById('atxtName
相关文档:
<SCRIPT LANGUAGE="JavaScript">
<!--
// Trim() , Ltrim() , RTrim()
String.prototype.Trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}
String.prototype.LTrim = function()
{
return this.replace(/(^\s*)/g, "");
}
String.prototype.RTrim = functio ......
1.大家在实际工作中,会写各式各样的赋值语句。
比如最常用的obj.style.display = "none";
如果这样的赋值语句一多,obj.style一排下来都要看晕了
下面我的base.js中的extend函数可以允许用json格式赋值属性甚至是函数句柄
/**
* 扩展函数
* @param target 需要扩展的对象
* @para ......
没有按别人的推荐,学什么圣经类的js书,而是随便挑了本《JavaScript in 10 Steps or Less》。
花了3个小时,看了30个task。
讲的非常浅显详细。虽然是E文,但很浅显易懂。
task31:
Calling Functions from Tags
One of the benefits of JavaScript is to be able to tie interactivity to elements of the HTML page. ......
javascript中的面像对像。
请看代码,下面弹出一个对话筐。
<script type="text/javascript">
function win(w, h,,url)
{
this.widt ......
/********************************************************************************/
//javascript在两个浮点数运算的时候会有比较明显的误差。增加下列方法解决。
//2009-07-18 Skyeah
//除法函数,用来得到精确的除法结果
//说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回 ......