You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mário Lopes <ma...@gmail.com> on 2006/05/24 12:34:55 UTC
Avoid template parsing
Is there any tag to avoid a certain block of code from being parsed on a .html?
I have some javascript on that file and it complains about things it shouldn't.
Regards.
-- Mário
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Avoid template parsing
Posted by Norbert Sándor <de...@erinors.com>.
What about commenting out the javascript (<!-- js -->), or embedding it
in a CDATA block (<![CDATA[ js ]]>)?
BR,
Norbi
Mário Lopes wrote:
> Is there any tag to avoid a certain block of code from being parsed on
> a .html?
>
> I have some javascript on that file and it complains about things it
> shouldn't.
>
> Regards.
>
> -- Mário
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Avoid template parsing
Posted by Jason Dyer <jd...@bluetarp.com>.
On Wednesday 24 May 2006 06:42, James Carman wrote:
> Can you give an example of the "things it shouldn't"?
Here's one:
<script type="text/javascript">
var unappliedAmount = 0;
updateTotal((+document.getElementById("startingUnapplied").innerHTML));
// alert("startingUnapplied = "+unappliedAmount);
function updateTotal(val) {
alert("updateTotal: " + val);
unappliedAmount = (+val);
var o = document.getElementById('toApplyAmount');
o.innerHTML = val;
if (unappliedAmount < 0) {
o.style.color = '#CC0000';
} else {
o.style.color = '#000000';
}
}
function setAmount(o, val) {
var iobj = o.parentNode.nextSibling.nextSibling.firstChild;
iobj.value = Math.min(val, unappliedAmount);
var echange = document.createEvent("HTMLEvents");
echange.initEvent('change', true, false);
iobj.dispatchEvent(echange);
}
</script>
If the '<' in 'if (unappliedAmount < 0) {' is removed/replaced, no problem,
but as is, tapestry throws a parsing error because it apparently thinks that
the '<' is the start of a tag...
My solution, btw, was to move the script to an external .js file.
-J
>
>
> -----Original Message-----
> From: Mário Lopes [mailto:mario.lopes@gmail.com]
> Sent: Wednesday, May 24, 2006 6:35 AM
> To: Tapestry users
> Subject: Avoid template parsing
>
> Is there any tag to avoid a certain block of code from being parsed on a
> .html?
>
> I have some javascript on that file and it complains about things it
> shouldn't.
>
> Regards.
>
> -- Mário
>
--
Any given program costs more and takes longer.
-- Murphy's Laws of Computer Programming n°8
--------------
Jason Dyer
BlueTarp Financial, inc.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
RE: Avoid template parsing
Posted by James Carman <ja...@carmanconsulting.com>.
Can you give an example of the "things it shouldn't"?
-----Original Message-----
From: Mário Lopes [mailto:mario.lopes@gmail.com]
Sent: Wednesday, May 24, 2006 6:35 AM
To: Tapestry users
Subject: Avoid template parsing
Is there any tag to avoid a certain block of code from being parsed on a
.html?
I have some javascript on that file and it complains about things it
shouldn't.
Regards.
-- Mário
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org