Mailing List Archive

Javascript w/ EmbperlObject
Hi

I thought I could place this in my EmbperlObject template:
<BODY [- Execute ('*#js_start') -]>

and this in the original file:

[$ sub js_start $] onLoad="nr.focus()" [$ endsub $]

But the result is this:

<HTML>
<HEAD>
<title> title
</title>
</HEAD>
onLoad="nr.focus()"
<BODY>

How will I produce an individual onLoad if I want to use EmbperlObjects ?

--
Kaare Rasmussen --Linux, spil,-- Tlf: 3816 2582
Kaki Data tshirts, merchandize Fax: 3816 2582
Howitzvej 75 Åben 14.00-18.00 Email: kar@webline.dk
2000 Frederiksberg Lørdag 11.00-17.00 Web: www.suse.dk
RE: Javascript w/ EmbperlObject [ In reply to ]
Hi
>
> I thought I could place this in my EmbperlObject template:
> <BODY [- Execute ('*#js_start') -]>
>

The current version of Embperl requires a

[- Execute ({ inputfile => '*', import => 0}) -]

before the first call to a subroutine in that file, to define the
subroutines in this file. The final release of 1.3 will make this
automaticly for you

Gerald


-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
RE: Javascript w/ EmbperlObject [ In reply to ]
> The current version of Embperl requires a
> [- Execute ({ inputfile => '*', import => 0}) -]

Sorry for not being too specific. I have that, and I do get the included item.
The problem is that I want it to go inside the <BODY>. It seems that EmbPerl
moves it outside the <BODY>. onLoad can only be used within <BODY>, that's the
problem.

Btw. Is it possible to have a conditional execution? I want to execute this
subroutine if it exists in the original file, but I don't want an error if it
doesn't.

--
Kaare Rasmussen --Linux, spil,-- Tlf: 3816 2582
Kaki Data tshirts, merchandize Fax: 3816 2582
Howitzvej 75 Åben 14.00-18.00 Email: kar@webline.dk
2000 Frederiksberg Lørdag 11.00-17.00 Web: www.suse.dk
RE: Javascript w/ EmbperlObject [ In reply to ]
> The problem is that I want it to go inside the <BODY>. It seems
> that EmbPerl
> moves it outside the <BODY>. onLoad can only be used within
> <BODY>, that's the
> problem.
>

Aah, now I see where the problem is. Execute will not work inside a html tag
that Embperl interprets. Currently only solution is to return the output of
the sub in a scalar and then include it in the body tag:

[.- Execute ({inputfile => '*', 'sub' => 'js_start', output => \$out}) -]
<BODY [+ $out +]>

this should work.

> Btw. Is it possible to have a conditional execution? I want to
> execute this
> subroutine if it exists in the original file, but I don't want an
> error if it
> doesn't.
>

At the moment not

Gerald



> --
> Kaare Rasmussen --Linux, spil,-- Tlf: 3816 2582
> Kaki Data tshirts, merchandize Fax: 3816 2582
> Howitzvej 75 Åben 14.00-18.00 Email: kar@webline.dk
> 2000 Frederiksberg Lørdag 11.00-17.00 Web: www.suse.dk
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
>
>