[thelist] Javascript: Preview a textarea in another window

Lars G. Skjellerup lars at skjellerup.net
Sat Jan 28 14:41:46 CST 2006


My 10 cent's:

Why not take a look at another way of doing it:

http://24ways.org/advent/edit-in-place-with-ajax

It uses prototype.js to make a Ajax call to the server (eventually to
process the input someway) without posting the whole page back to the
server.
I should be possible to adapt it to call a server script thru the ajax and
do a popup showing the preview.

On a side note: Dreadfull thing popups - should be avoided in imho.

--
Lars G. Skjellerup

> -----Original Message-----
> From: thelist-bounces at lists.evolt.org
> [mailto:thelist-bounces at lists.evolt.org] On Behalf Of Bill Moseley
> Sent: Saturday, January 28, 2006 9:29 PM
> To: thelist at lists.evolt.org
> Subject: Re: [thelist] Javascript: Preview a textarea in
> another window
>
> On Sat, Jan 28, 2006 at 08:36:13PM +0200, VOLKAN ÖZÇEL?K wrote:
> > Seems like overcomplicating things,
>
> That's often the problem.
>
>
> >
> > Why don't you open a server-side page with a real onload
> handler and
> > use a reference to the opener instead of overriding the
> onload event
> > from the page that opens it.
>
> Thanks, that works great.
>
> I don't know the id of the textarea ahead of time, but I can
> pass it though the server in a CGI parameter.
>
>
> <script type="text/javascript">
>     Event.observe(window, 'load', processOpener, false);
>
>     function processOpener(){
>         $('preview').innerHTML = opener.$('[%
> c.req.param('textarea') %]' ).value;
>
>         window.focus();
>     }
> </script>
>
> Window does not focus, though.  I also tried this.focus().
> Seems like that's what people use to bring windows back on top.
>
> Still, I'd like to figure out how to pass the text area
> through the server in a POST.  I'd like to be able to process
> the textarea before opening the preview window.
>
> Thanks for the help,
>
>
> --
> Bill Moseley
> moseley at hank.org
>
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip
> Harvester and archives of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !
>
>





More information about the thelist mailing list