Yeah, sorry about that :) I wrote that quite fast didn't I ?
the code should have been :
<html>
<head>
</head>
<body onload="doLoad();">
<script type="text/javascript">
function doLoad() {
if ( window.opener ) {
window.opener.refresh();
}
window.close();
}
</script>
</body>
</html>
TIP : you should only call functions directly inside HTML elements.
So, you should not do :
<body onload="alert('loaded');">
but instead
<body onload="doLoad();"> (or some other function)
and declare "doLoad" in a script tag.
-yanick
On 1 mai, 12:06, "Savoy, Melinda" <[EMAIL PROTECTED]>
wrote:
> Yanick,
>
> Please forgive these questions but needing some javascript help as I am
> no javascript expert, where is doLoad()? Also, would not having doLoad
> in the onload of the body close the pop-up window after the form is
> loaded.
>
> Can I put this script in a function and call it from an onsubmit within
> the form tag?
>
> Your help is appreciated. Regards.
>
> -----Original Message-----
> From: [email protected]
>
> [mailto:[EMAIL PROTECTED] On Behalf Of Yanick
> Sent: Tuesday, May 01, 2007 10:40 AM
> To: Ruby on Rails: Spinoffs
> Subject: [Rails-spinoffs] Re: Question on using prototype
>
> You don't need any library to do that. When your popup window refreshes,
> send something like this :
>
> <html>
> <head>
> </head>
> <body onload="doLoad();">
> <script type="text/javascript">
> if ( window.opener ) {
> window.opener.refresh();
> }
> window.close();
> </script>
> </body>
> </html>
>
> That will refresh the parent window (if there's one), then close itself.
>
> -yanick
>
> On 1 mai, 10:14, mel <[EMAIL PROTECTED]> wrote:
> > I am using the stripes framework and I'm stuck on a problem that I'm
> > hoping prototype can resolve.
>
> > In a parent window I use javascript to open up a second window pop-up
> > that contains a textarea and a submit button. When I click on the
> > submit button I execute a stripes actionBean that updates the database
>
> > and closes the pop-up window.
>
> > The parent window is still up and I am wondering how to get the parent
>
> > window that is already active updated. Can Ajax.Updater help with
> > that?
>
> > I've tried a suggestion of having a floating div with a textarea but
> > have not been able to make that work.
>
> > Any suggestions or direction would be appreciated.
>
> The information contained in this message and any attachments is intended
> only for the use of the individual or entity to which it is addressed, and
> may contain information that is PRIVILEGED, CONFIDENTIAL, and exempt from
> disclosure under applicable law. If you are not the intended recipient, you
> are prohibited from copying, distributing, or using the information. Please
> contact the sender immediately by return e-mail and delete the original
> message from your system.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---