You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Gustavo Vilela de Carvalho <gv...@trt15.gov.br> on 2005/11/18 16:58:18 UTC

Javascript.

I can't use Javascript in Lenya.  How can I?  

--
Tribunal Regional do Trabalho da 15a. Regiao
(http://www.trt15.gov.br)


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


Re: Javascript.

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Gustavo Vilela de Carvalho wrote:
>   Yes.  I have the following script :
> 
>             <script language="JavaScript">
> var agora = new Date();
> var anoN = agora.getYear()
> var mesN = agora.getMonth() + 1;
> var diaNr = ((agora.getDate()<10) ? "0" : "")+ agora.getDate();
> if(mesN==1) mes="janeiro";
> if(mesN==2) mes="fevereiro";
> if(mesN==3) mes="março";
> if(mesN==4) mes="abril";
> if(mesN==5) mes="maio";
> if(mesN==6) mes="junho";
> if(mesN==7) mes="julho";
> if(mesN==8) mes="agosto";
> if(mesN==9) mes="setembro";
> if(mesN==10) mes="outubro";
> if(mesN==11) mes="novembro";
> if(mesN==12) mes="dezembro";
> if (anoN<1900) anoN += 1900;
> var DiaHoje =("Campinas, "+diaNr+" de "+mes+" de "+anoN);
> document.write(DiaHoje);
> 
> </script>

two things: in xhtml, script is pcdata, not cdata as in html, which 
means you have to escape > to &gt; and < to &lt;

http://javascript.about.com/library/blxhtml.htm

also, document.write() does not work in xhtml.

http://www.w3.org/MarkUp/2004/xhtml-faq#docwrite


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


Re: Javascript.

Posted by Gustavo Vilela de Carvalho <gv...@trt15.gov.br>.
  Yes.  I have the following script :

            <script language="JavaScript">
var agora = new Date();
var anoN = agora.getYear()
var mesN = agora.getMonth() + 1;
var diaNr = ((agora.getDate()<10) ? "0" : "")+ agora.getDate();
if(mesN==1) mes="janeiro";
if(mesN==2) mes="fevereiro";
if(mesN==3) mes="março";
if(mesN==4) mes="abril";
if(mesN==5) mes="maio";
if(mesN==6) mes="junho";
if(mesN==7) mes="julho";
if(mesN==8) mes="agosto";
if(mesN==9) mes="setembro";
if(mesN==10) mes="outubro";
if(mesN==11) mes="novembro";
if(mesN==12) mes="dezembro";
if (anoN<1900) anoN += 1900;
var DiaHoje =("Campinas, "+diaNr+" de "+mes+" de "+anoN);
document.write(DiaHoje);

</script>

  I should show the date in my page ( I inserted this in the xhtml.xml ) but
it simply doesn't show anything.  It works fine in a normal html page.
  I've done something wrong?


On Fri, 18 Nov 2005 11:01:47 -0500, Bob Harner wrote
> Can you be more specific?   Lenya uses javascript in a lot of places,
> both server- and client-side.  Please tell us what you're trying to
> do.
> 
> On 11/18/05, Gustavo Vilela de Carvalho <gv...@trt15.gov.br> wrote:
> > I can't use Javascript in Lenya.  How can I?
> >
> > --
> > Tribunal Regional do Trabalho da 15a. Regiao
> > (http://www.trt15.gov.br)
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> > For additional commands, e-mail: dev-help@lenya.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org


--
Tribunal Regional do Trabalho da 15a. Regiao
(http://www.trt15.gov.br)


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


Re: Javascript.

Posted by Bob Harner <bo...@gmail.com>.
Can you be more specific?   Lenya uses javascript in a lot of places,
both server- and client-side.  Please tell us what you're trying to
do.

On 11/18/05, Gustavo Vilela de Carvalho <gv...@trt15.gov.br> wrote:
> I can't use Javascript in Lenya.  How can I?
>
> --
> Tribunal Regional do Trabalho da 15a. Regiao
> (http://www.trt15.gov.br)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
>
>

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