|
|
 |
RE: FN-FORUM: Javascript security model?
date posted 14th January 2008 09:35
> -----Original Message-----
> From: [EMAIL REMOVED] [EMAIL REMOVED] On Behalf Of Tim
> Pizey
> Sent: 14 January 2008 00:50
> To: FN-FORUM / [EMAIL REMOVED]
> Subject: FN-FORUM: Javascript security model?
>
>
> Hi,
>
> I am trying to change a frames based javascript tree browser to
> work in a single page, regardless of whether that page is in a frame,
> standalone page or popup window.
>
> To try to get back to basics I wrote the following:
>
>
>
>
> function sayHi() {
> alert("you");
> }
> function init() {
> document.open();
> document.write("Hi");
> document.close();
> }
>
>
>
>
>
>
> when this worked in Konqueror but not in Opera or Firefox I decided I
> needed
> help.
>
> Both Opera and Firefox say that sayHi is undefined when you click on
> the link,
> which is displayed in all three.
How come you're using document.open() and close()? I thought open() was to
open a popup window. Also, it seems a bit strange to be calling code that
writes to the document in an onload thing - you could try having a DIV or
something and writing to that using innerHTML
(http://developer.mozilla.org/en/docs/DOM:element.innerHTML)
Phil
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.19.2/1223 - Release Date: 13/01/2008
20:23
|
 |
|