Hi kangax, thanks for your reply. I will show you my test case.
Please test it in IE6.

1. The following code is defined in parent window which named
'test1.html'.(note : all script was written within head tag)
<script type="text/javascript" src="js/prototype-1.6.0.3.js"></script>
<script type="text/javascript">
        ClassA = Class.create({
                test : function () {
                        alert("this is a test method");
                }
        });
        window.open("test2.html");
</script>

2. The following code is defined in subwindow which named
'test2.html'.
<script type="text/javascript">
        a = new opener.ClassA();
        a.test();
</script>

These code works very well with in Firefox2.

And, I also write another test case.It gets the same result.
1. in test1.html
<script type="text/javascript">
function ClassA() {
        this.test = function () {
                alert("this is a test method");
        }
}
window.open("test2.html");
</script>

2. in test2.html
<script type="text/javascript">
        a = new opener.ClassA();
        a.test();
</script>

My question is if I want a Class was defined only once in my
application,how to live it ?
I notice that you mention the question regarding cross-frame
scripting, it seems ok in Firefox.

Best Regards,
Eric

On 1月17日, 上午1时35分, kangax <kan...@gmail.com> wrote:
> On Jan 16, 3:10 am, Eric <smcdl6...@gmail.com> wrote:
>
> [...]
>
> > Who can tell me why ?
>
> Prototype doesn't have much support for cross-frame scripting. Some
> things work and some don't. If you could attach a minimal test case,
> I'll look into what exactly is going on.
>
> --
> kangax
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to