perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Smith <smi...@gmail.com>
Subject Re: EMBPERL: Calling Execute() multiple time per a page.
Date Thu, 25 Aug 2016 22:16:00 GMT
500 times - that's a lot!

Maybe you could run it once offline, and save the result as HTML?

Just an idea.

On Thu, Aug 25, 2016 at 10:35 PM, Donavon <donl@mycopanet.com> wrote:

> I have a loop that is calling Execute() to load a EMBPERL page as a
> template.  This template sets up and contains a bootstrap modal and some
> javascript .  The page I'm using as a test calls the template at least 500x.
>
> This is really slowing down the loading of the page for the client.
>
> Are there any suggestion for optimizing and / or speeding this up?
>
> Thank You,
> ~Donavon
> djlerman@yahoo.com
>
>
> [$ while ( ($ID) = $sth->fetchrow) $]
>
> 	[-
>                 %opts              = ();                $opts{ID}          = $ID;
>                 $opts{title}       = "Modal Title";
>                 $opts{footer}      = "Modal Footer";
>                 $opts{frameSrc}    = "file.epl";
>                 $opts{linkText}    = 'Click Me to Open Modal';
> 		Execute("template.epl", \%opts);
> 	-]
>
> [$ endwhile $]
>
>
> *--- **template.epl*
>
> [-
>   (%param)     = %{$param[0]};
> -]
> <!-- trigger modal -->
> <a  id          = "trigger_[+ $param{ID} +]"
>     title       = "[+ $param{title} +]"
>     alt         = "[+ $param{title} +]"
>     style       = "cursor:pointer;"
>     >
>   [- $escmode = 0; -][+ $param{linkText} +][- $escmode = 1; -]
> </a>
> <script>
>
>
>   $('#trigger_[+ $param{ID} +]').click(function(){
>     var frameSrc = "[- $escmode = 0; -][+ $param{frameSrc} +][- $escmode = 1; -]";
>
>     $('#iframe_[+ $param{ID} +]').attr("src",frameSrc);
>
>     $('#modal_[+ $param{ID} +]').modal({show:true})
>   });
>
> </script>
>
>
> <!-- modal -->
> <div class="modal fade pageWidth" id="modal_[+ $param{ID} +]" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel">
>   <div class="modal-dialog pageWidth" role="document">
>     <div class="modal-content">
>       <div class="modal-header">
>         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
>         <h4 class="modal-title" id="myModalLabel">
>           [+ $param{title} +]
>         </h4>
>       </div>
>       <div class="modal-body">
>         <iframe id="iframe_[+ $param{ID} +]" src="" frameborder="0" height="400" class="pageFull"></iframe>
>       </div>
>       <div class="modal-footer">
>         [+ $param{footer} +] <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
>       </div>
>     </div>
>   </div>
> </div>
>
>
>
>

Mime
View raw message