I'm not so sure...
I've run into similar problems with event-based systems. What I've
done to work around it (it's a hack) is to define a function in the
page that creates the popup attached to the window, and fire the event
from there rather than from the popped-up page.
Example:
In your primary page, add this:
window.testScript = function(){
alert('foo');
}
window.open("test2.html");
then, in the popup (test2.html in this case) add:
window.opener.testScript();
Assuming they're running in the same domain, the function in your
primary page should get called and you'll see the alert.
From there, try firing your event instead of alerting, and see if it works.
I've attached some sample files that work on my machine.
-Jerod
On Tue, Sep 16, 2008 at 11:04 AM, bluezehn <[EMAIL PROTECTED]> wrote:
>
> Well any other suggestions would fall outside the scope of prototype
> and javascript, you'd want to look into trying to set the target of
> the form to be the popup window, but I'm not sure if that's possible.
> I know it's a technique used for file uploads ala Ajax - people point
> the form at an embedded iframe which does the uploading - but I don't
> think you can do this to target a from at a different browser window.
>
> You're going to have to find a completely different popup free way of
> doing this if you want communication between the two pages, I fear.
>
> On Sep 16, 3:41 pm, buda <[EMAIL PROTECTED]> wrote:
>> Thanks for reply
>> You are right - its pop up window - unfortunately its impossible to
>> rearchitect a large project to act in one window through divs
>> representation
>>
>> So, any other suggestion?
>>
>> On 16 сент, 15:55, bluezehn <[EMAIL PROTECTED]> wrote:
>>
>> > Do you mean separate browser windows? If you do, good luck getting
>> > this to work as the two browser windows have separate doms, therefore
>> > when the event fires it will bubble up through the dom in the window
>> > of the form element, but there's absolutely no point at which that
>> > event is going to work its way into the dom of your other window.
>>
>> > My advice: popup browser windows are not cool. I know I never see them
>> > as I (like every Firefox or IE7 user) have a popup blocker which is
>> > going to make sure your window doesn't appear. So instead of poping up
>> > a whole new browser window, which is outdated, inefficient and not
>> > dependable, make a new div element. Set this div to have fixed
>> > positioning central to the screen in css, and then put whatever you
>> > want in there. That way it can still share the same event set, the
>> > browser has no way of blocking it, it doesn't create a whole new
>> > browser instance, it can be customised to the styles of your site, it
>> > isn't annoying, it's quicker and just so much better.
>>
>> > I may have misunderstood what you mean with windows and child windows
>> > in which case the above may have been irrelevant and/or patronising.
>> > If this is the case I apologise and please explain what you mean by
>> > "open child window from the first window"
>>
>> > On Sep 16, 12:50 pm, buda <[EMAIL PROTECTED]> wrote:
>>
>> > > I do follow:
>>
>> > > in the first window I register an observer
>>
>> > > forms[0].observe('Form:changed', function(){ alert('Eventis fired') })
>>
>> > > then I open child window from the first window and in the child window
>> > > I try to fire event in the opener window
>>
>> > > var f = $(window.opener.forms[0])
>> > > f.fire('Form:changed', 'lalala');
>>
>> > > but the event doesnt fired
>> > > Why?- Скрыть цитируемый текст -
>>
>> > - Показать цитируемый текст -
> >
>
--
Jerod Venema
Senior Software Engineer
Nth Penguin, LLC
http://www.nthpenguin.com
(919) 368-5105
---
WebWidgetry.com / MashupStudio.com
Future Home of the World's First Complete Web Platform
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---
test1
test2