velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barbara Baughman <baugh...@utdallas.edu>
Subject Re: some escape character
Date Fri, 04 Aug 2006 13:45:23 GMT
When in doubt, I find the most straightforward way to do it is to:
#set($q='"')

#set ($AJAXurl = $link.setAction("ShowRegionAddForm"))
#button("ADD" "javascript:retrieveURL($q$AJAXurl$q)")<br>

This approach takes less brainpower to implement and is easier to read
than escape characters, which I don't think Velocity has anyway.  I
use this quite often in HTML-based templates.

Barbara Baughman
X2157

On Fri, 4 Aug 2006, dizzi wrote:

> It has probably pretty simple solution but i cant figure it anyway :)
>
> #macro(button $name $url)
> 	<div class="button"><a href="$url">$name</a></div>
> #end
>
>
> #set ($AJAXurl = $link.setAction("ShowRegionAddForm"))
> #button("ADD" "javascript:retrieveURL($AJAXurl)")<br>
>
> is renedered like "javascript:retrieveURL(/tors/ShowRegionAddForm.do)"
>
> I need "javascript:retrieveURL("/tors/ShowRegionAddForm.do")"
>
> How can i tell velocity that quote in macro parameter is part of string
> and not argument
>
>
> #button("ADD" "javascript:retrieveURL('$AJAXurl')")<br>
>
> this works nice, but what if i need " and not ' :)
>
> thx dizzi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

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


Mime
View raw message