You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Geert Verhaag <g....@lrcb.nl> on 2007/11/08 14:39:56 UTC

Betr.: Re: How to call External Javascript from xhtml2xhtml.xsl?

Thanks for the link to the resources. By the way I use Lenya 1.2! Okay,
I've put the following basic
function into MYPUB/resources/javascript:

function myfunction()
{
 var tekst= 'Hello!';
 document.write(tekst);
}

The link <a href="javascript:myfunction();">Test</a> doesn't seem to
work however, at least it doesn't show me the word Hello!

The error console of FireFox, the browser I prefer to use, contains the
message: myfunction is not defined!

Regards,
Gerard

>>> thorsten.scherler.ext@juntadeandalucia.es 08/11/2007 13:22 >>>
On Thu, 2007-11-08 at 13:10 +0100, Geert Verhaag wrote:
> Dear Lenya'rs,
> 
> I'm struggling with calling an external Javascript from within the
> xhtml2xhtml.xsl file.
> 
> The following is a new match I've added to it: 
> 
>   <xsl:template match="xhtml:div[@id = 'abstract']">
>     <p>
>      <script language="javascript" type="text/javascript"
> src="myscript.js"/>
>      <a href="javascript:myscript(myargument);">Abstract</a></p>
>   </xsl:template>
> 
> I'd like to actually run the script when clicking the Abstract link
on
> the final html page.
> 
> At what location has the script to reside within the directory of my
> publication?

http://lenya.apache.org/docs/1_2_x/components/layout/static-resources.html


HTH

salu2

> 
> Can anybody give me a hint on this, please? Thanks!
> 
> Regards,
> Gerard
>  
> 
> ==========================================
> 
> Dit bericht is uitsluitend bestemd voor de geadresseerde.
> Het bericht kan vertrouwelijke informatie bevatten.
> Als u dit bericht per abuis hebt ontvangen, wordt u
> verzocht onmiddellijk de afzender te informeren. Ook
> verzoeken wij u het bericht te vernietigen en de inhoud
> niet onder derden te verspreiden of te gebruiken.
> 
> This message is intended exclusively for the addressee.
> It may contain information that is confidential.
> If you are not the intended recipient, we request that
> you notify the sender immediately. In that case, we
> also request that you destroy the message and that
> you neither use the contents nor disclose them in any
> manner to third parties.
> ==========================================
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org 
> For additional commands, e-mail: user-help@lenya.apache.org 
> 
-- 
Thorsten Scherler                                
thorsten.at.apache.org
Open Source Java                      consulting, training and
solutions


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org 
For additional commands, e-mail: user-help@lenya.apache.org 

 

==========================================

Dit bericht is uitsluitend bestemd voor de geadresseerde.
Het bericht kan vertrouwelijke informatie bevatten.
Als u dit bericht per abuis hebt ontvangen, wordt u
verzocht onmiddellijk de afzender te informeren. Ook
verzoeken wij u het bericht te vernietigen en de inhoud
niet onder derden te verspreiden of te gebruiken.

This message is intended exclusively for the addressee.
It may contain information that is confidential.
If you are not the intended recipient, we request that
you notify the sender immediately. In that case, we
also request that you destroy the message and that
you neither use the contents nor disclose them in any
manner to third parties.
==========================================


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Betr.: Re: How to call External Javascript from xhtml2xhtml.xsl?

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Thu, 2007-11-08 at 16:48 +0100, Andreas Hartmann wrote:
> Thorsten Scherler schrieb:
> > On Thu, 2007-11-08 at 14:39 +0100, Geert Verhaag wrote:
> >> Thanks for the link to the resources. By the way I use Lenya 1.2! Okay,
> >> I've put the following basic
> >> function into MYPUB/resources/javascript:
> > 
> > Can you try $YOURPUB/resources/shared/javascript/myscript.js like Jörn
> > pointed out?
> > 
> > What does localhost:8888/$YOURPUB/myscript.js return?
> 
> IIUC that should read
> 
>   localhost:8888/$YOURPUB/authoring/javascript/myscript.js

Yeah, thanks for pointing out.

salu2


> 
> doesn't it?
> 
> -- Andreas
> 
> > 
> > salu2
> > 
> >> function myfunction()
> >> {
> >>  var tekst= 'Hello!';
> >>  document.write(tekst);
> >> }
> >>
> >> The link <a href="javascript:myfunction();">Test</a> doesn't seem to
> >> work however, at least it doesn't show me the word Hello!
> >>
> >> The error console of FireFox, the browser I prefer to use, contains the
> >> message: myfunction is not defined!
> >>
> >> Regards,
> >> Gerard
> >>
> >>>>> thorsten.scherler.ext@juntadeandalucia.es 08/11/2007 13:22 >>>
> >> On Thu, 2007-11-08 at 13:10 +0100, Geert Verhaag wrote:
> >>> Dear Lenya'rs,
> >>>
> >>> I'm struggling with calling an external Javascript from within the
> >>> xhtml2xhtml.xsl file.
> >>>
> >>> The following is a new match I've added to it: 
> >>>
> >>>   <xsl:template match="xhtml:div[@id = 'abstract']">
> >>>     <p>
> >>>      <script language="javascript" type="text/javascript"
> >>> src="myscript.js"/>
> >>>      <a href="javascript:myscript(myargument);">Abstract</a></p>
> >>>   </xsl:template>
> >>>
> >>> I'd like to actually run the script when clicking the Abstract link
> >> on
> >>> the final html page.
> >>>
> >>> At what location has the script to reside within the directory of my
> >>> publication?
> >> http://lenya.apache.org/docs/1_2_x/components/layout/static-resources.html
> >>
> >>
> >> HTH
> >>
> >> salu2
> >>
> >>> Can anybody give me a hint on this, please? Thanks!
> >>>
> >>> Regards,
> >>> Gerard
> >>>  
> >>>
> >>> ==========================================
> >>>
> >>> Dit bericht is uitsluitend bestemd voor de geadresseerde.
> >>> Het bericht kan vertrouwelijke informatie bevatten.
> >>> Als u dit bericht per abuis hebt ontvangen, wordt u
> >>> verzocht onmiddellijk de afzender te informeren. Ook
> >>> verzoeken wij u het bericht te vernietigen en de inhoud
> >>> niet onder derden te verspreiden of te gebruiken.
> >>>
> >>> This message is intended exclusively for the addressee.
> >>> It may contain information that is confidential.
> >>> If you are not the intended recipient, we request that
> >>> you notify the sender immediately. In that case, we
> >>> also request that you destroy the message and that
> >>> you neither use the contents nor disclose them in any
> >>> manner to third parties.
> >>> ==========================================
> >>>
> >>>
> >>>
> >> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org 
> >>> For additional commands, e-mail: user-help@lenya.apache.org 
> >>>
> 
> 
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Betr.: Re: How to call External Javascript from xhtml2xhtml.xsl?

Posted by Andreas Hartmann <an...@apache.org>.
Thorsten Scherler schrieb:
> On Thu, 2007-11-08 at 14:39 +0100, Geert Verhaag wrote:
>> Thanks for the link to the resources. By the way I use Lenya 1.2! Okay,
>> I've put the following basic
>> function into MYPUB/resources/javascript:
> 
> Can you try $YOURPUB/resources/shared/javascript/myscript.js like Jörn
> pointed out?
> 
> What does localhost:8888/$YOURPUB/myscript.js return?

IIUC that should read

  localhost:8888/$YOURPUB/authoring/javascript/myscript.js

doesn't it?

-- Andreas

> 
> salu2
> 
>> function myfunction()
>> {
>>  var tekst= 'Hello!';
>>  document.write(tekst);
>> }
>>
>> The link <a href="javascript:myfunction();">Test</a> doesn't seem to
>> work however, at least it doesn't show me the word Hello!
>>
>> The error console of FireFox, the browser I prefer to use, contains the
>> message: myfunction is not defined!
>>
>> Regards,
>> Gerard
>>
>>>>> thorsten.scherler.ext@juntadeandalucia.es 08/11/2007 13:22 >>>
>> On Thu, 2007-11-08 at 13:10 +0100, Geert Verhaag wrote:
>>> Dear Lenya'rs,
>>>
>>> I'm struggling with calling an external Javascript from within the
>>> xhtml2xhtml.xsl file.
>>>
>>> The following is a new match I've added to it: 
>>>
>>>   <xsl:template match="xhtml:div[@id = 'abstract']">
>>>     <p>
>>>      <script language="javascript" type="text/javascript"
>>> src="myscript.js"/>
>>>      <a href="javascript:myscript(myargument);">Abstract</a></p>
>>>   </xsl:template>
>>>
>>> I'd like to actually run the script when clicking the Abstract link
>> on
>>> the final html page.
>>>
>>> At what location has the script to reside within the directory of my
>>> publication?
>> http://lenya.apache.org/docs/1_2_x/components/layout/static-resources.html
>>
>>
>> HTH
>>
>> salu2
>>
>>> Can anybody give me a hint on this, please? Thanks!
>>>
>>> Regards,
>>> Gerard
>>>  
>>>
>>> ==========================================
>>>
>>> Dit bericht is uitsluitend bestemd voor de geadresseerde.
>>> Het bericht kan vertrouwelijke informatie bevatten.
>>> Als u dit bericht per abuis hebt ontvangen, wordt u
>>> verzocht onmiddellijk de afzender te informeren. Ook
>>> verzoeken wij u het bericht te vernietigen en de inhoud
>>> niet onder derden te verspreiden of te gebruiken.
>>>
>>> This message is intended exclusively for the addressee.
>>> It may contain information that is confidential.
>>> If you are not the intended recipient, we request that
>>> you notify the sender immediately. In that case, we
>>> also request that you destroy the message and that
>>> you neither use the contents nor disclose them in any
>>> manner to third parties.
>>> ==========================================
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org 
>>> For additional commands, e-mail: user-help@lenya.apache.org 
>>>


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Betr.: Re: How to call External Javascript from xhtml2xhtml.xsl?

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Thu, 2007-11-08 at 14:39 +0100, Geert Verhaag wrote:
> Thanks for the link to the resources. By the way I use Lenya 1.2! Okay,
> I've put the following basic
> function into MYPUB/resources/javascript:

Can you try $YOURPUB/resources/shared/javascript/myscript.js like Jörn
pointed out?

What does localhost:8888/$YOURPUB/myscript.js return?

salu2

> 
> function myfunction()
> {
>  var tekst= 'Hello!';
>  document.write(tekst);
> }
> 
> The link <a href="javascript:myfunction();">Test</a> doesn't seem to
> work however, at least it doesn't show me the word Hello!
> 
> The error console of FireFox, the browser I prefer to use, contains the
> message: myfunction is not defined!
> 
> Regards,
> Gerard
> 
> >>> thorsten.scherler.ext@juntadeandalucia.es 08/11/2007 13:22 >>>
> On Thu, 2007-11-08 at 13:10 +0100, Geert Verhaag wrote:
> > Dear Lenya'rs,
> > 
> > I'm struggling with calling an external Javascript from within the
> > xhtml2xhtml.xsl file.
> > 
> > The following is a new match I've added to it: 
> > 
> >   <xsl:template match="xhtml:div[@id = 'abstract']">
> >     <p>
> >      <script language="javascript" type="text/javascript"
> > src="myscript.js"/>
> >      <a href="javascript:myscript(myargument);">Abstract</a></p>
> >   </xsl:template>
> > 
> > I'd like to actually run the script when clicking the Abstract link
> on
> > the final html page.
> > 
> > At what location has the script to reside within the directory of my
> > publication?
> 
> http://lenya.apache.org/docs/1_2_x/components/layout/static-resources.html
> 
> 
> HTH
> 
> salu2
> 
> > 
> > Can anybody give me a hint on this, please? Thanks!
> > 
> > Regards,
> > Gerard
> >  
> > 
> > ==========================================
> > 
> > Dit bericht is uitsluitend bestemd voor de geadresseerde.
> > Het bericht kan vertrouwelijke informatie bevatten.
> > Als u dit bericht per abuis hebt ontvangen, wordt u
> > verzocht onmiddellijk de afzender te informeren. Ook
> > verzoeken wij u het bericht te vernietigen en de inhoud
> > niet onder derden te verspreiden of te gebruiken.
> > 
> > This message is intended exclusively for the addressee.
> > It may contain information that is confidential.
> > If you are not the intended recipient, we request that
> > you notify the sender immediately. In that case, we
> > also request that you destroy the message and that
> > you neither use the contents nor disclose them in any
> > manner to third parties.
> > ==========================================
> > 
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org 
> > For additional commands, e-mail: user-help@lenya.apache.org 
> > 
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Betr.: Re: How to call External Javascript from xhtml2xhtml.xsl?

Posted by Andreas Hartmann <an...@apache.org>.
Hi Geert,

Geert Verhaag schrieb:
> Thanks for the link to the resources. By the way I use Lenya 1.2! Okay,
> I've put the following basic
> function into MYPUB/resources/javascript:

I assume you put it in the file resources/javascript/myscript.js?
Did you try to access this file in the browser?

-- Andreas

> 
> function myfunction()
> {
>  var tekst= 'Hello!';
>  document.write(tekst);
> }
> 
> The link <a href="javascript:myfunction();">Test</a> doesn't seem to
> work however, at least it doesn't show me the word Hello!
> 
> The error console of FireFox, the browser I prefer to use, contains the
> message: myfunction is not defined!
> 
> Regards,
> Gerard
> 
>>>> thorsten.scherler.ext@juntadeandalucia.es 08/11/2007 13:22 >>>
> On Thu, 2007-11-08 at 13:10 +0100, Geert Verhaag wrote:
>> Dear Lenya'rs,
>>
>> I'm struggling with calling an external Javascript from within the
>> xhtml2xhtml.xsl file.
>>
>> The following is a new match I've added to it: 
>>
>>   <xsl:template match="xhtml:div[@id = 'abstract']">
>>     <p>
>>      <script language="javascript" type="text/javascript"
>> src="myscript.js"/>
>>      <a href="javascript:myscript(myargument);">Abstract</a></p>
>>   </xsl:template>
>>
>> I'd like to actually run the script when clicking the Abstract link
> on
>> the final html page.
>>
>> At what location has the script to reside within the directory of my
>> publication?
> 
> http://lenya.apache.org/docs/1_2_x/components/layout/static-resources.html
> 
> 
> HTH
> 
> salu2
> 
>> Can anybody give me a hint on this, please? Thanks!
>>
>> Regards,
>> Gerard
>>  
>>
>> ==========================================
>>
>> Dit bericht is uitsluitend bestemd voor de geadresseerde.
>> Het bericht kan vertrouwelijke informatie bevatten.
>> Als u dit bericht per abuis hebt ontvangen, wordt u
>> verzocht onmiddellijk de afzender te informeren. Ook
>> verzoeken wij u het bericht te vernietigen en de inhoud
>> niet onder derden te verspreiden of te gebruiken.
>>
>> This message is intended exclusively for the addressee.
>> It may contain information that is confidential.
>> If you are not the intended recipient, we request that
>> you notify the sender immediately. In that case, we
>> also request that you destroy the message and that
>> you neither use the contents nor disclose them in any
>> manner to third parties.
>> ==========================================
>>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org 
>> For additional commands, e-mail: user-help@lenya.apache.org 
>>


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org