Article View: borland.public.jbuilder.java.language
Article #8814Re: Content From Applet to Browser - Is it possible?
From: Michael Kutscher
Date: Wed, 28 Feb 2001 12:02
Date: Wed, 28 Feb 2001 12:02
50 lines
2772 bytes
2772 bytes
Hi!
> Michael -- I *think* I get the drift of your solution, but could you
expound
> upon it a bit? I have the exact same need -- my applet results have to
> split out a subsequent Web page.
It's simple... when you're ready with it:
My applet has a public function, lets call it
public String output()
this function returns the complete content of the page, i want to show, from
"<html>" to "</html>".
I call this function from a _javascript_ like this:
function test()
{
var a;
var p;
var win;
p=window.document.applets["myappletsname"];
if (p!=null)
{
a=p.output();
window.document.open("text/html");
window.document.writeln(a);
}
else
{
setTimeout("test()",500);
// in case, the applet isn't loaded yet.
};
};
It works with IE5 and NS4.7... don't know about NS6 or others.
Remember: The applet must put a complete web-page into the return-string...
so in my application there is a repetion of the entire page (including the
script) within the applet. It gets easier, when you put the script in a
seperate scriptfile... but I don't want people to change anything :-)
Hope it helps
Michael
P.S.: You can see it here, but it's in german (it takes birthday, month and
year as input and shows a horoscope):
www.aussersinnlich.de/horoskop/horox.html
Technical Details
Message-ID:
<97ipfe$ab2$02$1@news.t-online.com>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!colt.net!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mailReferences:
<970lgt$ohq$04$1@news.t-online.com> <3A940E89.9247BC9B@formlessvoid.com> <9714ag$2lu$06$1@news.t-online.com> <971dk5$v7f$00$1@news.t-online.com> <3A944D16.4E69D533@formlessvoid.com> <3a948f63$1_2@dnews> <3A953D84.307CCBEF@formlessvoid.com> <976o1n$ca8$01$1@news.t-online.com> <3a9cc63b$1_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,fb050902fdd5be70 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-02-28 04:10:02 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!colt.net!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: "Michael Kutscher" <Michael-Kutscher@pc-coach.de> Newsgroups: borland.public.jbuilder.java.language Subject: Re: Content From Applet to Browser - Is it possible? Date: Wed, 28 Feb 2001 13:02:03 +0100 Organization: T-Online Lines: 53 Message-ID: <97ipfe$ab2$02$1@news.t-online.com> References: <970lgt$ohq$04$1@news.t-online.com> <3A940E89.9247BC9B@formlessvoid.com> <9714ag$2lu$06$1@news.t-online.com> <971dk5$v7f$00$1@news.t-online.com> <3A944D16.4E69D533@formlessvoid.com> <3a948f63$1_2@dnews> <3A953D84.307CCBEF@formlessvoid.com> <976o1n$ca8$01$1@news.t-online.com> <3a9cc63b$1_1@dnews> Reply-To: "Michael Kutscher" <Michael-Kutscher@pc-coach.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.t-online.com 983361838 02 10594 i850iPTSS-pd+ 010228 12:03:58 X-Complaints-To: abuse@t-online.com X-Sender: 053149969-0001@t-dialin.net X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400