如何设定框架页面的状态栏?
发布: 2010-3-09 06:17 | 作者: 网友 | 来源: 网络 | 查看: 5次
注:
self.status、self.parent.status、self.top.status、window.status、window.parent.status、window.top.status
均已试过,均无效!
---------reply--------------
- JScript code
-
parent.要获取的frame名.信息
---------reply--------------
看错,是window.status,不能访问看看是不是你跨域访问了
---------reply--------------
---------reply--------------
同一个站点的,跨域的问题倒是不存在
---------reply--------------
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> </title>
<script language="javascript" type="text/javascript">
function> menu.aspx: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="menu.aspx.cs" Inherits="CommonPages_menu" %> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>菜单页</title> <link href="../Css/css.css" rel="stylesheet" type="text/css" /> <link href="../Css/added_css.css" rel="stylesheet" type="text/css" /> <script language="javascript" type="text/javascript"> window.parent.status="hello"; </script> </head> <body onmouseover="SetStatus();"> <form id="form1" runat="server"> …… ---------reply-------------- 写错了,是 <body> <%@ Page Language="C#" AutoEventWireup="true" CodeFile="menu.aspx.cs" Inherits="CommonPages_menu" %> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>菜单页</title> <link href="../Css/css.css" rel="stylesheet" type="text/css" /> <link href="../Css/added_css.css" rel="stylesheet" type="text/css" /> <script language="javascript" type="text/javascript"> function SetStatus(){ self.parent.window.status="hello"; } </script> </head> <body onmousemove="SetStatus();"> …… ---------reply-------------- 此种情况下,我上面列举的各种写法均无效。
---------reply--------------- HTML code
-
<div><iframe src="test.htm">="test()"></iframe></div>
function test(){
window.status="hello"
}
---------reply--------------
方法在
frame 标签里引入就ok了,测试onmouseover通过 ---------reply-------------- 在子窗口加入
window.onload=function(){
window.status="heoooo"
}
测试也通过.. ---------reply-------------- 奇怪,我的还是不行。
注意到你用iframe
我用的frameset,有关系吗?
---------reply-------------- 那我知道原因了,浏览器...
如果是IE7+
方法是:工具--》Internet 选项--》安全 -- 选中Internet后 点自定义级别 --》找到“允许状态栏通过脚本 更新”,将默认的禁用改为启用就行了。 ---------reply-------------- ff下也是
window.status在firefox下默认是不能修改的。。
可以通过工具->选项->网页特性->启用javascript->高级->把修改状态栏 文本打上勾就好了 ---------reply-------------- ---------reply-------------- ...白折腾了这么久
呵呵
