请快速帮助FRAMES(另一个问题) [英] Quick help please with FRAMES (another question)

查看:77
本文介绍了请快速帮助FRAMES(另一个问题)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

行。经过多次游戏后,我设法得到我的框架页面这个

远...见下面的代码。


但是......它仍然有错误,以及我想要发生的事情

发生的是:


1)在左框架(文件LeftEx8_2.html)上有一系列按钮,

点击后提示用户输入背景信息

颜色,文字颜色,链接颜色,标题和一些文字。


但这是我的问题:一些按钮已经在左边框架中启动了,但不是所有按钮都被启动了,当点击上面列出的所有上面的

信息应该显示在右框架。


2)左框架也应该有一个按钮,可以进入右框架(文件

RightEx8_2.html)页面。


当用户按下按钮的最后一次按钮时,左框架的内容应出现在右框架上,

。 (文件:

Ex8_2.html)


所以....我如何让这一切工作?我得到了很大的帮助,所以

远,虽然不是我一直在寻找的东西。但是我很好

真的很困惑,我正在寻求帮助。 ....


我在一些回复中指出,人们一直在引用XHTML。我是

a新的Javascript用户(并且在没有

级联样式表和XHTML的情况下完成此页面。请使用简单的HTML)..我必须

使用记事本创建脚本,使用Internet Explorer版本6.0

查看已创建的内容。


任何想法?

(以下所有3页编码......)


// *这是左框架页* \\

< HTML>

< HEAD>


< TITLE>练习Left8-2 - 带文档对象的左框架页< / TITLE>


< SCRIPT LANGUAGE =" JavaScript">


var leftFrame = top.frames [0] .document;

var rightFrame = top.frames [1] .document;

var rightDoc = top.frames [1];


function checkField(field)

{

if(field.value ==""){

alert(" Please enter a back ground Color) ;


field.focus();

返回false; //不要提交表格

}


}


< / SCRIPT>

< / HEAD>


< BODY>


< H3>这是练习的左侧文件8-2< / H3>


< SCRIPT LANGUAGE =" JavaScript">


var username = prompt(" Welcome)练习8-2,输入你的名字

here);

// alert(欢迎来到练习8-2);


document.write(用户名+"欢迎来到练习8-2");


< / SCRIPT>

< H1 Align = center> <字体面= Arial颜色=绿色>练习8-2 -

JavaScript按钮< / Font>< / H1>

<中心>

< Font Face = Arial Size = 3 Color = Green>


< FORM NAME =" FrmMyForm"行动= QUOT; Right8-2.html" onSubmit =" return

checkField(MyFieldData);">

输入背景颜色:

< INPUT TYPE =" ;文本"名称= QUOT; MyFieldData" onBlur ="">

< INPUT TYPE =" Submit">


< INPUT TYPE =" button" VALUE =改变背景颜色 NAME =" MyField"

onClick =" rightFrame.bgColor =''blue''">


< INPUT type ="按钮" value ="变为红色! name =" redbutton"

onClick =" rightFrame.bgColor =''red''"> < br>


< INPUT type =" button" value ="变为黄色! name =" yellowbutton"

onClick =" rightFrame.bgColor =''yellow''"> < br>


< INPUT type =" button" VALUE =更改为蓝色! NAME =" Bluebutton"

onClick =" rightFrame.bgColor =''blue''">< BR>


< INPUT TYPE =”按钮" NAME =" buttonPrint" VALUE =" Print"

onClick =" rightDoc.print()">


< INPUT type =" button" value ="转到右页 name =" rightbutton"

onClick =" rightFrame.location =''Right8-2.html''">


< /表格>

< / BODY>

< / HTML>


// *这是正确的框架页面* \\

< HTML>

< HEAD>


< TITLE>锻炼Right8-2 - 右带文件的框架页

对象< / TITLE>

< / head>


< body>


< H3>这是练习8-2的正确文件< / H3>


< / body>

< / HTML>


// *并且这是MAIN框架页面 - Ex8_2.html * \\

< HTML>

< HEAD>


< TITLE>练习8-2 - 带文档对象的框架页< / TITLE>


< / HEAD>


< FRAMESET COLS =" 50%,50%"


< FRAME NAME = LeftFrame SRC =" Left8-2.html" name =" lFr">

< FRAME NAME = RightFrame SRC =" Right8-2.html" name =" rFr">

< / FRAMESET>

< / HTML>


那是'它。会对此有所帮助........

OK. After much playing around, I managed to get my frame page this
far.. see code below.

BUT...there are still errors with it, and what I would like to have
happened is this:

1) On the Left Frame (File LeftEx8_2.html) a series of buttons, which
when clicked prompt the user to enter information for background
color, text color, link color, title and some text.

BUT HERE IS MY PROBLEM: some buttons have been started in the left
frame, but not all of them and when clicked all the above listed
information should show up on the Right frame.

2) Left frame should also have a button to go to the Right frame (File
RightEx8_2.html) page.

The contents of the LEFT frame should be present on the RIGHT frame,
when the final click of a button has been pushed by the user. (File:
Ex8_2.html)

So....How do I get all this to work? I have had tremendous help so
far, although not quite what I have been looking for..anyways I''m
really confused on this and am seeking help please.....

I noted on some of the responses, people have been quoting XHTML. I am
a new Javascript user (and perfer this page to be done without a
cascading style sheet, and XHTML. Just plain HTML please)..I have to
use Notepad for creating the script, and Internet Explorer version 6.0
to view what had been created.

Any ideas?
(All 3 pages of coding below...)

//* This is the LEFT FRAME PAGE *\\
<HTML>
<HEAD>

<TITLE>Exercise Left8-2 - LEFT FRAME PAGE with Document Object</TITLE>

<SCRIPT LANGUAGE="JavaScript">

var leftFrame = top.frames[0].document;
var rightFrame = top.frames[1].document;
var rightDoc = top.frames[1];

function checkField (field)
{
if (field.value == "") {
alert("Please enter a Back ground Color");

field.focus();
return false; // don''t submit the form
}

}

</SCRIPT>
</HEAD>

<BODY>

<H3>This is the left document of Exercise 8-2</H3>

<SCRIPT LANGUAGE="JavaScript">

var username = prompt("Welcome to Exercise 8-2", "Enter your name
here");
// alert("Welcome to Exercise 8-2");

document.write(username + " Welcome to Exercise 8-2");

</SCRIPT>

<H1 Align=center> <Font Face=Arial Color=Green> Exercise 8-2 -
JavaScript Buttons </Font></H1>
<Center>
<Font Face=Arial Size=3 Color=Green>

<FORM NAME="FrmMyForm" action="Right8-2.html" onSubmit = "return
checkField(MyFieldData);">
Enter a Back Ground Color:
<INPUT TYPE="text" Name="MyFieldData" onBlur="">
<INPUT TYPE="Submit">

<INPUT TYPE="button" VALUE="Change Back Ground Color" NAME="MyField"
onClick="rightFrame.bgColor=''blue'' ">

<INPUT type="button" value="Change to Red!" name="redbutton"
onClick="rightFrame.bgColor=''red''"> <br>

<INPUT type="button" value="Change to Yellow!" name="yellowbutton"
onClick="rightFrame.bgColor=''yellow''"> <br>

<INPUT type="button" VALUE="Change to Blue!" NAME="Bluebutton"
onClick="rightFrame.bgColor=''blue''"><BR>

<INPUT TYPE="button" NAME="buttonPrint" VALUE="Print"
onClick="rightDoc.print()">

<INPUT type="button" value="Go to the Right Page" name="rightbutton"
onClick="rightFrame.location=''Right8-2.html''">

</FORM>
</BODY>
</HTML>

//*This is the RIGHT frame Page*\\
<HTML>
<HEAD>

<TITLE>Exercise Right8-2 - Right FRAME PAGE with Document
Object</TITLE>
</head>

<body>

<H3>This is the right document of Exercise 8-2</H3>

</body>
</HTML>

//*and This is the MAIN Frame Page - Ex8_2.html*\\
<HTML>
<HEAD>

<TITLE>Exercise 8-2 - FRAME PAGE with Document Object</TITLE>

</HEAD>

<FRAMESET COLS="50%,50%">

<FRAME NAME=LeftFrame SRC="Left8-2.html" name= "lFr">
<FRAME NAME=RightFrame SRC="Right8-2.html" name = "rFr">
</FRAMESET>
</HTML>

That''s it. Would appreaciate any help on this........

推荐答案

42
42




对不起Erwin .....什么是42?

***通过Developersdex发送 http://www.developersdex.com ***

不要只是参加USENET ......获得奖励!

Sorry Erwin.....What is 42 ?
*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!


Trvl Orm写道:
Trvl Orm wrote:
对不起Erwin .....什么是42?
Sorry Erwin.....What is 42 ?




答案。


答案是什么?


生命,宇宙......一切。


- 来自:The Hitchhiker's Galaxy指南道格拉斯亚当斯。 :)


可能意味着你的问题很模糊。 (我不能告诉

因为我没有看到你的问题,你最近发帖太多了

最近要保证)。

Richard。



The answer.

The answer to what?

Life, the Universe ... everything.

- from: "The Hitchhiker''s Guide to the Galaxy" by Douglas Adams. :)

Probably intended to imply that your question was vague. (I cannot tell
because I haven''t read your question, you have been top posting too much
recently to warrant that).

Richard.


这篇关于请快速帮助FRAMES(另一个问题)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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