- 浏览: 1371218 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (551)
- 计划 (4)
- java (115)
- oracle (60)
- ajax (3)
- javascript (64)
- 计算机操作技巧集 (11)
- 近期关注话题 (10)
- 随想 (13)
- html (6)
- struts (15)
- hibernate (16)
- spring (2)
- game (0)
- Eglish (10)
- DisplayTag (6)
- jsp (18)
- css (3)
- eclipse (3)
- 其他知识 (8)
- 备用1 (12)
- 备用2 (1)
- 笑话-放松心情 (9)
- 设计 (1)
- 设计模式 (1)
- 数据结构 (0)
- office办公软件 (5)
- webwork (0)
- tomcat (2)
- MySql (1)
- 我的链接资源 (5)
- xml (2)
- servlet (0)
- PHP (13)
- DOM (0)
- 网页画图vml,canvas (1)
- 协议 (2)
- 健康 (3)
- 书籍下载 (1)
- jbpm (1)
- EXT (1)
- 自考 (2)
- 报表 (4)
- 生活 (64)
- 操作系统基础知识 (2)
- 测试 (2)
- guice (1)
- google学习 (2)
- Erlang (1)
- LOG4J (2)
- wicket (1)
- 考研 (1)
- 法律 (1)
- 地震 (1)
- 易学-等等相关 (1)
- 音乐 (1)
- 建站 (4)
- 分享说 (3)
- 购物省钱 (0)
- linux (1)
最新评论
-
zenmshuo:
如果使用SpreadJS这一类的表格工具,应该能更好的实现这些 ...
js中excel的用法 -
hjhj2991708:
第一个已经使用不了
jar包查询网站 非常好用! -
jiangmeiwei:
...
中文乱码 我的总结 不断更新 -
gary_bu:
...
response.sendRedirect 中文乱码问题解决 -
hnez:
多谢指点,怎么调试也不通,原来我在<body>&l ...
ExtJs IE ownerDocument.createRange() 错误解决方案
原文
http://sharkysoft.com/tutorials/jsa/content/038.html
mixing functions and frames
I have three files, a "parent frame" file and the two files which are loaded into the frames set up by the parent. Also in the parent frame I have a javascript function defined.
In one of the frames, I need to call that function in the parent frame. I have it set up like so:
<BODY onLoad="parent.buildindx();">
In MS Internet Explorer it works great. It does just what I want it to. However, in Netscape 3.01, it gives me an error saying "window.buildindx not a function".
It seems as though, in Explorer, it allows it to be called using the parent (window) object, but in Netscape it doesn't recognize it.
I may be doing something wrong, but I would appreciate any advice you could give me.
-- John
When a JavaScript function is defined in a document, the function becomes a method of the window or frame object in which it is defined. In JavaScript, windows and frames are treated similarly, and for the purposes of this article I will use the term "frame" to indicate either "frame" or "window."
In order for one frame to call a function defined in another frame, the caller must have a reference to the frame object containing the function. In most cases, this is just
parent . frame_name
In a two-framed document containing frames named "left" and "right," for example, the left frame can call the right frame's functions through the expression
parent . right . function_name (parameters)
Similarly, to call a function defined in the parent, or frameset document, all you need is a reference to the parent. Thus, the expression
parent . function_name (parameters)
is sufficient to call the parent frame's functions.
It appears that this is exactly what you were trying to do -- that is, to call a parent frame's function from within a child frame. Based on what you have told me, it also appears that your code is correct. So why, do you suppose, does it work in Internet Explorer but not in Netscape Navigator?
I did some research for you and came up with a startling conclusion. The current release of Netscape completely ignores JavaScript that is placed after the opening <frameset> tag of a frameset document. This means that if you want to call a function defined in a frameset document, the function definition should occur before the first <frameset> tag.
Charlton Rose
April 25, 1997
http://sharkysoft.com/tutorials/jsa/content/038.html
mixing functions and frames
I have three files, a "parent frame" file and the two files which are loaded into the frames set up by the parent. Also in the parent frame I have a javascript function defined.
In one of the frames, I need to call that function in the parent frame. I have it set up like so:
<BODY onLoad="parent.buildindx();">
In MS Internet Explorer it works great. It does just what I want it to. However, in Netscape 3.01, it gives me an error saying "window.buildindx not a function".
It seems as though, in Explorer, it allows it to be called using the parent (window) object, but in Netscape it doesn't recognize it.
I may be doing something wrong, but I would appreciate any advice you could give me.
-- John
When a JavaScript function is defined in a document, the function becomes a method of the window or frame object in which it is defined. In JavaScript, windows and frames are treated similarly, and for the purposes of this article I will use the term "frame" to indicate either "frame" or "window."
In order for one frame to call a function defined in another frame, the caller must have a reference to the frame object containing the function. In most cases, this is just
parent . frame_name
In a two-framed document containing frames named "left" and "right," for example, the left frame can call the right frame's functions through the expression
parent . right . function_name (parameters)
Similarly, to call a function defined in the parent, or frameset document, all you need is a reference to the parent. Thus, the expression
parent . function_name (parameters)
is sufficient to call the parent frame's functions.
It appears that this is exactly what you were trying to do -- that is, to call a parent frame's function from within a child frame. Based on what you have told me, it also appears that your code is correct. So why, do you suppose, does it work in Internet Explorer but not in Netscape Navigator?
I did some research for you and came up with a startling conclusion. The current release of Netscape completely ignores JavaScript that is placed after the opening <frameset> tag of a frameset document. This means that if you want to call a function defined in a frameset document, the function definition should occur before the first <frameset> tag.
Charlton Rose
April 25, 1997
发表评论
-
给HTML增加自定义属性
2010-01-08 16:40 3184增加自定义属性 <input type="te ... -
ExtJs IE ownerDocument.createRange() 错误解决方案
2009-12-07 09:22 3832在开发ExtJs程序的过程中,遇到如下问题:在firefox中 ... -
js面向对象
2009-07-30 17:40 1131关于js 面向对象的优秀文章的连接 有困难,找猪八戒 htt ... -
javascript辅助方法--不断更新
2009-05-08 11:19 1030有困难,找猪八戒 对js中的辅助方法进行收集,不断补充 /*得 ... -
javascript js 飘浮 图片 或者 文字
2009-03-25 19:18 2331本文引自http://www.webmasters-centr ... -
js去掉开头和结尾的空格 js trim
2009-03-24 10:07 7293/* * 去掉开头和结尾的space, tab, form ... -
js中excel的用法
2009-03-18 08:57 8527有困难,找猪八戒 转载自: http://hi.baidu.c ... -
js insertCell colspan
2009-03-12 14:37 4874转自:http://objectmix.com/javascr ... -
js IE关闭窗口
2009-01-15 20:08 1981参考文章: http://www.webdeveloper.c ... -
js客户端验证上传文件大小
2009-01-13 16:05 4810有困难,找猪八戒 function getFileSize(f ... -
偶然发现一个小工具,查看颜色
2008-12-30 13:15 1744偶然发现一个小工具,查看颜色 另外,再加上两个小工作:颜色和像 ... -
window.open 方法怪问题 参数失效
2008-10-31 18:12 2412window.open(URL,name,specs,repl ... -
一些浏览器的屏蔽功能
2008-10-30 18:23 1413http://www.putiancheng.com/tool ... -
一个好用的js树 梅花雪MzTreeView
2008-10-24 19:20 3813主要是速度特别快 用另外一个js树,要100秒,用这个,1秒 ... -
解决JavaScript页面刷新与弹出窗口问题
2008-10-11 09:45 1892解决JavaScript页面刷新与弹出窗口问题 原文:htt ... -
js 定位 光标 到输入框的 指定位置
2008-10-02 16:20 5826//从此处摘得 http://www.experts-exch ... -
js 正则表达式 从网上找的
2008-09-25 09:01 10881、//校验IP格式 function a(ip_addres ... -
Javascript: 两个列表框之间移动数据
2008-09-11 11:41 1799http://topic.csdn.net/t/2002052 ... -
未结束的字符串常量 中文引起
2008-08-02 11:37 7030因为外部js文件中包含 ... -
javascript 框架相关资源记录
2008-06-11 14:00 1184介绍jquery的 http://www.iteye.com/ ...
相关推荐
在C#编程中,获取调用函数的参数名称和值是一项常见的需求,特别是在日志记录、调试或动态处理参数时。下面将详细讲解如何在C#中实现这一功能。 首先,我们要了解C#中的反射机制。反射是.NET框架提供的一种强大工具...
在探讨“函数之间调用同一个对象方法”的主题时,我们首先需要理解几个核心概念:函数、对象、方法以及事件监听器。这些概念是现代编程语言,尤其是面向对象编程语言中的基石,它们共同构建了复杂软件系统的逻辑框架...
在调用函数时,我们需要知道函数的入口地址,以便CPU能正确地跳转到函数的起始位置执行。 2. **参数传递**:函数调用时可能需要传递参数,这些参数可以放在寄存器或者栈中。在x86架构下,通常先使用EAX, EBX, ECX, ...
2. 返回地址保存:调用函数前,当前指令的地址(即调用函数后的下一条指令)被保存到堆栈帧中,以便在函数返回时恢复。 3. 堆栈帧创建:为新函数分配空间,存储局部变量和其他必要信息。 4. 控制转移:执行流从调用...
本文将详细讲解如何使用JavaScript在frame与frame之间进行值的传递。 首先,了解基本概念。`window`对象是浏览器的全局对象,它提供了对浏览器窗口的各种控制,包括访问框架。`frames`属性是`window`对象的一个成员...
每次函数调用都会在堆栈上创建一个新的帧(Frame),存储返回地址和局部变量等信息。通过遍历这个堆栈,我们可以逆序地查看函数调用的顺序,从而得知哪些函数调用了目标函数。 在C++中,实现堆栈追踪通常有两种方法...
本篇文章将深入探讨如何在Qt中调用JavaScript函数并传递参数,以实现更丰富的功能。 首先,Qt的Webkit模块是实现这一目标的关键。Qt Webkit是一个基于WebKit引擎的组件,它允许Qt应用渲染网页内容,并与网页进行...
本示例着重讲解如何利用`Frame`控件的`Navigate`函数来实现页面间的导航,并且通过设置`NavigationUIVisibility`属性隐藏导航UI,使得界面更加简洁,更适合初学者学习。 首先,我们需要了解`Frame`控件。`Frame`是...
"iframe子父页面调用js函数示例" 在实际项目中,iframe 子父页面调用 js 函数是非常有用的。下面是一个示例,演示如何在 iframe ...6. JS 实现 iframe 跨页面调用函数的方法 7. JS 如何对 Iframe 内外页面进行操作总结
在这个场景下,涉及到的一个常见需求就是如何用JavaScript在主页面与`iframe`页面之间互相调用函数,以便于进行更复杂的交互。 标题提到的问题是在各种浏览器中,尤其是考虑到跨浏览器兼容性时,如何用JS实现主页面...
当函数A调用函数B时,B的栈帧会建立在A的栈帧下方,A的返回地址被压入栈中,以便B返回后能正确返回到A的下一条指令。 函数调用和返回主要由CALL和RET指令完成。CALL指令将返回地址压栈并跳转到被调用函数,RET指令...
在pr2_3_1程序中调用了frame2time函数,用于计算分帧后每一帧对应时间。 名称:frame2time 功能:计算分帧后每一帧对应的时间。 调用格式:frameTime=frame2time(frameNum,framelen,inc,fs)
例如,`iframe`中的`jsp`页面可以调用父页面的JavaScript函数: ```jsp ;charset=UTF-8" language="java" %> <title>iframe内的页面 function sendDataToParent(data) { window.parent.postMessage(data, "*...
在JavaScript中,实现iframe跨页面调用函数是一个常见的需求,特别是在构建复杂的Web应用程序时。当一个页面(父页面)嵌入了另一个页面(子页面)作为iframe时,有时需要在两个页面之间通信,调用各自的功能。下面...
标题“同级iframe间的函数调用”涉及的是如何在不同`iframe`之间共享数据和交互,这是跨域安全策略下实现页面间通信的一种方式。 在同一个域名下,`iframe`可以相互访问,这是因为它们被视为同一源(same-origin ...
这里,`int(4)`和`int(5)`将字符串转换为整数类型,然后通过`Add`调用`count.py`中的`add`函数,将结果存储在变量`add`中。 **5. 注释** 在Robot Framework中,注释可以通过`Comment`关键字或Python的`#`符号来...
window 对象的 self 属性包含当前窗口的标志,利用这个属性,可以保证在多个窗口被打开的情况下,正确调用当前窗口内的函数或属性而不会发生混乱。 9. name 属性 window 对象的 name 属性返回窗口名称,这个名称是...
- **压栈**:在进入函数之前,系统会在堆栈上保存当前的上下文,包括返回地址(调用函数后的下一条指令)、局部变量和参数。这个过程称为“压栈”。 - **执行**:函数体内的代码开始执行,可以访问其自己的局部...
在C语言中,每个函数调用都会在内存中创建一个新的栈帧(stack frame),该栈帧用于存储函数的局部变量、参数和返回地址等信息。栈帧的结构通常包括以下几个部分: * 函数的返回地址:存储函数的返回地址,以便在...
enframe的一般调用格式为: y=enframe(x,framelength,step);...这时每帧数据都乘了窗函数hanning(framelength)。step是指一帧与一帧之间移动的样点数,有的称为非重叠的长度。 ---------------------