[thelist] Welcome to the "thelist" mailing list
yan zhihong
yanzhihong at sz.tom.com
Thu Nov 17 20:26:01 CST 2005
thanks very much.
this way can solve the "alert" issue,
but if I want get the content of the frame,say,filter a word and return the position to the method caller that set the new frame's "src" property,I run into a synchronize issue.
look my code please:
test.html:
<HTML><HEAD></HEAD>
<FRAMESET cols="20%,80%" title="test" >
<frame src="click.html" name="testFrame" title="test..." >
<frame src="some.html" name="sourceFrame" title="test" scrolling="yes" onload="top.testFrame.getsource1()">
<NOFRAMES>
</NOFRAMES>
</FRAMESET>
</HTML>
click.html:
<html>
<head>
<script language="javascript">
var ll=0;
function test() {
while(ll==1){}
setsource1("a.html");
ll=1;
while(ll==1){}
setsource1("b.html");
ll=1;
while(ll==1){}
setsource1("c.html");
}
function getsource1() {
alert(top.sourceFrame.document.documentElement.innerText);
ll=0;
}
function setsource1(s) {
top.sourceFrame.location=s;
}
function getsource(s){
//setsource1(s);
//setTimeout("getsource1()",1);
//setTimeout("setsource1(\""+s+"\")",10);
//getsource1();
}
</script>
</head>
<body>
<form>
<input type="button" onclick="test()" value="Test"">
</form>
</body>
</html>
I define the "ll" as a flag that signify the "onload" event has trig the "getSource1" method so I can set new src and go on.
but,I the loop is a dead loop,seems that "onload" event never been produced.dont know why.
----- Original Message -----
From: "Kowalkowski, Lee (ASPIRE)" <lee.kowalkowski at hmrcaspire.com>
To: <thelist at lists.evolt.org>
Sent: Wednesday, November 16, 2005 7:03 PM
Subject: Re: [thelist] Welcome to the "thelist" mailing list
> > yan zhihong wrote:
> >
> > <FRAME src="source.html" name="sourceFrame"
> > title="test" scrolling="yes">
>
> Add the following attribute to this line:
> onload="top.testFrame.getsource1()"
>
> This will also alert the source when the frameset loads, I'm sure you could
> alter your code to suppress this the first time if you don't like it.
>
> - LK
>
>
> ===========================================================
> Our e-mail domain has now changed from iraspire.com to hmrcaspire.com. Please update your address books.
> ===========================================================
>
> --
>
> * * Please support the community that supports you. * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
More information about the thelist
mailing list