Re: FN-FORUM: Javascript security model?
date posted 14th January 2008 19:43
On Monday 14 January 2008 00:49, Tim Pizey wrote:
> 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.
>
> Pointers to a good reference would be great, as I have googled in vain.
>
Thanks for the feedback.
First error appears to be docuement.open() which deletes all content of
document.
Second error would be returning anything from the href call, this should
return nothing or you navigate to the string.
I should also be setting the window onload, but IE thought that that could be
malicious.
So the result that works in IE, Firefox, Opera and Konqueror:
test
//
cheers
TimP