You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Audrius Peseckis <au...@ivs.lt> on 2006/02/23 12:57:02 UTC

T4 IMarkupWriter and JavaScript

Hello,

I'm trying to get my custom renderer work with DirectLink. What I'm trying to do is achieve something like this:

<a href="javascript:if(confirm('Are you sure about something?')){document.location.href='SOME_URL';};">LINK</a>

When I try to write all this stuff as an attribute (IMarkupWriter.attribute("href", javascripPart)), by some reason each space in javascript is separated in tag as a different attribute. If I use attributeRaw(), those spaces are converted to %xx stuff.

So neither of previously mentioned methods work for me. Is there a clean way to add javascript to attribute which would be treated as javascript? Any suggestions are welcome.

Thanks,
Audrius

Re: T4 IMarkupWriter and JavaScript

Posted by Audrius Peseckis <au...@ivs.lt>.
Thanks

----- Original Message ----- 
From: "Nicolas" <sc...@gmail.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Thursday, February 23, 2006 1:59 PM
Subject: Re: T4 IMarkupWriter and JavaScript


you can try :

<a href="your real url" onclick="return confirm('sure about that
?')">link</a>

this way the href attribute can be treated as a real url.

Regards,
Nicolas

On 2/23/06, Audrius Peseckis <au...@ivs.lt> wrote:
>
> Hello,
>
> I'm trying to get my custom renderer work with DirectLink. What I'm trying
> to do is achieve something like this:
>
> <a href="javascript:if(confirm('Are you sure about something?')){
> document.location.href='SOME_URL';};">LINK</a>
>
> When I try to write all this stuff as an attribute (
> IMarkupWriter.attribute("href", javascripPart)), by some reason each space
> in javascript is separated in tag as a different attribute. If I use
> attributeRaw(), those spaces are converted to %xx stuff.
>
> So neither of previously mentioned methods work for me. Is there a clean
> way to add javascript to attribute which would be treated as javascript? 
> Any
> suggestions are welcome.
>
> Thanks,
> Audrius
>


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


Re: T4 IMarkupWriter and JavaScript

Posted by Nicolas <sc...@gmail.com>.
you can try :

<a href="your real url" onclick="return confirm('sure about that
?')">link</a>

this way the href attribute can be treated as a real url.

Regards,
Nicolas

On 2/23/06, Audrius Peseckis <au...@ivs.lt> wrote:
>
> Hello,
>
> I'm trying to get my custom renderer work with DirectLink. What I'm trying
> to do is achieve something like this:
>
> <a href="javascript:if(confirm('Are you sure about something?')){
> document.location.href='SOME_URL';};">LINK</a>
>
> When I try to write all this stuff as an attribute (
> IMarkupWriter.attribute("href", javascripPart)), by some reason each space
> in javascript is separated in tag as a different attribute. If I use
> attributeRaw(), those spaces are converted to %xx stuff.
>
> So neither of previously mentioned methods work for me. Is there a clean
> way to add javascript to attribute which would be treated as javascript? Any
> suggestions are welcome.
>
> Thanks,
> Audrius
>