改变“SRC”框架的属性 [英] Changing the "SRC" attribute of a frame

查看:70
本文介绍了改变“SRC”框架的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好;


My" index.htm"页面有3帧(内容,导航栏和徽标)。


我设置了SRC。 徽标框架到空白的gif图像然后想要

在使用来自导航的

javascript语句加载其他两个框架后更改它的内容;框架,如下图所示:


top.window.ccs_logo.src =''images / ccs_logo.gif'';

alert(top.window。 ccs_logo.src);


top ...正在作为警报工作显示SRC。已更改,但

徽标中的图像框架没有改变。


我花了几个小时搜索谷歌,但似乎无法找到我是什么

过度看。 (如果需要发布更多代码或其他详细信息,

请告诉我。)


任何人都可以帮助我


TIA。


Charles ...

---

外发邮件经过认证无病毒。

由AVG反病毒系统检查( http:// www。 grisoft.com)

版本:6.0.674 /病毒库:436 - 发布日期:5/2/04

解决方案

Charles Crume写道:

你好;
我的index.htm页面有3帧(内容,导航栏和徽标)。

我设置了SRC。 徽标框架到空白的gif图像,然后想要通过使用来自导航的
javascript语句加载其他两个帧后改变它的内容。框架,如下图所示:

top.window.ccs_logo.src =''images / ccs_logo.gif'';
alert(top.window.ccs_logo.src);

顶部......正在作为警报工作显示SRC。已更改,但
图像中的徽标框架没有改变。

我花了几个小时搜索谷歌,但似乎无法找到我在过度看的东西。 (如果需要发布更多代码或其他详细信息,请告知我们。)

任何人都可以帮助我。
TIA。
Charles ... 。




查尔斯,试试这个:


top.logo.document.ccs_logo.src =''images / ccs_logo。 gif'';


Mike


mscir写道:

Charles Crume写道:

你好;
我的index.htm页面有3帧(内容,导航栏和徽标)。

我设置了SRC。 徽标框架到空白的gif图像,然后
想要在
使用来自导航的
javascript语句加载其他两个框架之后更改它的内容;框架,如下图所示:

top.window.ccs_logo.src =''images / ccs_logo.gif'';
alert(top.window.ccs_logo.src);

顶部......正在作为警报工作显示SRC。已经改变了,但是徽标中的图像已经改变了。框架没有改变。

我花了几个小时搜索谷歌,但似乎无法找到
我看起来过度。 (如果需要发布更多代码或其他详细信息,请告知我们。)

任何人都可以帮助我。
TIA。
Charles ... 。



查尔斯,试试这个:

top.logo.document.ccs_logo.src =''images / ccs_logo.gif'';




更正:我读错了你的留言。我想这可能会做你想要的:


top.logo.location.href =''images / ccs_logo.gif'';


Charles Crume写道:

你好;

我的index.htm页面有3帧(内容,导航栏和徽标)。

我设置了SRC。 徽标框架到空白的gif图像,然后想要通过使用来自导航的
javascript语句加载其他两个帧后改变它的内容。框架,如下图所示:

top.window.ccs_logo.src =''images / ccs_logo.gif'';
alert(top.window.ccs_logo.src);

顶部......正在作为警报工作显示SRC。已更改,但
图像中的徽标框架不会改变。




您没有更改框架的来源,您正在设置top.window的

a属性


你不能更改框架的SRC,你改变它的HREF属性。


top.window.css_logo.href = " someOtherPage.html";


多数民众赞成假设框架窗口的名称是css_logo

-

Randy

机会有利于准备好的心灵

comp.lang.javascript常见问题 - http://jibbering.com/faq/


Hello;

My "index.htm" page has 3 frames (content, navigation bar, and logo).

I set the "SRC" of the "logo" frame to a blank gif image and then want to
change it''s contents after the other two frames have been loaded by using a
javascript statement from the "navigation" frame, as shown below:

top.window.ccs_logo.src = ''images/ccs_logo.gif'';
alert(top.window.ccs_logo.src);

The "top..." is working as the "alert" shows the "SRC" has been changed, but
the image in the "logo" frame does not change.

I have spent several hours searching google but can''t seem to find what I''m
over-looking. (If more code, or additional details, need to be posted,
please let me know.)

Can anyone help me out

TIA.

Charles...
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.674 / Virus Database: 436 - Release Date: 5/2/04

解决方案

Charles Crume wrote:

Hello;
My "index.htm" page has 3 frames (content, navigation bar, and logo).

I set the "SRC" of the "logo" frame to a blank gif image and then want to
change it''s contents after the other two frames have been loaded by using a
javascript statement from the "navigation" frame, as shown below:

top.window.ccs_logo.src = ''images/ccs_logo.gif'';
alert(top.window.ccs_logo.src);

The "top..." is working as the "alert" shows the "SRC" has been changed, but
the image in the "logo" frame does not change.

I have spent several hours searching google but can''t seem to find what I''m
over-looking. (If more code, or additional details, need to be posted,
please let me know.)

Can anyone help me out
TIA.
Charles...



Charles, try this:

top.logo.document.ccs_logo.src = ''images/ccs_logo.gif'';

Mike


mscir wrote:

Charles Crume wrote:

Hello;
My "index.htm" page has 3 frames (content, navigation bar, and logo).

I set the "SRC" of the "logo" frame to a blank gif image and then
want to
change it''s contents after the other two frames have been loaded by
using a
javascript statement from the "navigation" frame, as shown below:

top.window.ccs_logo.src = ''images/ccs_logo.gif'';
alert(top.window.ccs_logo.src);

The "top..." is working as the "alert" shows the "SRC" has been
changed, but
the image in the "logo" frame does not change.

I have spent several hours searching google but can''t seem to find
what I''m
over-looking. (If more code, or additional details, need to be posted,
please let me know.)

Can anyone help me out
TIA.
Charles...


Charles, try this:

top.logo.document.ccs_logo.src = ''images/ccs_logo.gif'';



Correction: I read your message wrong. I think this might do what you want:

top.logo.location.href=''images/ccs_logo.gif'';


Charles Crume wrote:

Hello;

My "index.htm" page has 3 frames (content, navigation bar, and logo).

I set the "SRC" of the "logo" frame to a blank gif image and then want to
change it''s contents after the other two frames have been loaded by using a
javascript statement from the "navigation" frame, as shown below:

top.window.ccs_logo.src = ''images/ccs_logo.gif'';
alert(top.window.ccs_logo.src);

The "top..." is working as the "alert" shows the "SRC" has been changed, but
the image in the "logo" frame does not change.



You are not changing the source of the frame with that, you are setting
a property of the top.window

You don''t change the SRC of a frame, you change its HREF property.

top.window.css_logo.href="someOtherPage.html";

Thats assuming the name of the frame window is css_logo
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/


这篇关于改变“SRC”框架的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆