perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Derrick Spell <>
Subject Re: javascript variables in embperl tag
Date Fri, 18 Nov 2005 19:02:07 GMT
Well, I'm certainly not a javascript expert, but it seems to me that  
the issue here is how to make data pulled by embperl on the server  
side available to the javascript on the client side.

I assume that there is a way to access submitted form data from  
javascript.  You can put the data into %fdat and then it will be  
available to the javascript as though it was submitted from a form.   
The javascript can then sort/format and display.


"Perl's grammar can not be reduced to BNF.
The work of parsing perl is distributed between
yacc, the lexer, smoke and mirrors.''
-Chaim Frenkel

On Nov 18, 2005, at 1:08 PM, Ben Kim wrote:

> This may be a basic question, but is there a way to manipulate  
> javascript
> functions and variables within embperl syntax? (Would it be  
> possible to
> add this if it does not exist?)
> For example, let's say I populated a large javascript array/hash  
> from a
> database call, and want to resort, rearrange or filter out at will  
> from
> the client side only without further making a database call.
> I might use javascript's document.write, but I wonder if it's  
> possible in
> embperl space (maybe a new tag?), like
> <script>var myarray=new Array(1,3,4,7);</script>
> [=myarray[0]=] instead of document.write
> which will do the same as
> [-my @myarray=(1,3,4,7)-]
> [+$myarray[0]+]
> It can be used with Data::JavaScript::Anon, or even Ajax like  
> things, I
> suppose.
> Or, what is the best practice, if the same data need to be resorted /
> filtered?
> Regards,
> Ben Kim
> Developer
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message