Another pattern is to push as much javascript into .js files, as
parameterized functions. Then from the webpage, you can call the
appropriate function with the appropriate values.
So you limit the js that you maintain within the template.
Britske wrote:
Hi ,
I have a template which includes a javascript-function:
function asyncCall (){
if(($('quickTextField').value.length > 2))
{
new Ajax.Request ('${quickSearchBoxLink}',
{asynchronous:true,onSuccess:handleResponse});
}
}
However, this gets converted to (note the > instead of '>' (greater than)
:
function asyncCall (){
alert($('quickTextField').value);
if(document.getElementById("quickTextField").value.length
> 3)
{
new Ajax.Request
('/aanbiedingen.quicknavigation:quickSearchBoxAction',
{asynchronous:true,onSuccess:handleResponse});
}
}
Obviously this is because the template outputs well-formed XHTML.
Still I need to include the function in the template since I need '
${quickSearchBoxLink}' to be translated by Tapestry. How to proceed?
Thanks,
Geert-Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]