Re: [phplib] Re: odd behaviour when parse()-ing a block From: Dima Nemchenko (Dima.Nemchenko <email protected>)
Date: 06/05/01

Maxim Derkachev wrote:

> Hello Dima,
>
> Tuesday, June 05, 2001, 3:34:00 PM, you wrote:
>
> DN> What is the recommended way to embed JavaScript in Templates?
>
> Just don't forget to leave spaces around the text between { and }.
> E.g. if (a) {a=b;} within the template would cause a=b; interpreted as a
> variable placeholder (which is obviously not the thing you expect).
> But if (a) { a=b; } would be left untouched.
> The same apply to CSS styles: { color:green } works, but {color:green}
> does not.
>
> --
> Best regards,
> Maxim Derkachev mailto:max.derkachev <email protected>

Privet Maxim,

The JavaScript "{}" are going through the PHPLib parsing ok, it's the
document.write() that is f-ing it up! What happens is that all sorts of HTML
codes like "&lt;" and "&nbsp;" get changed into plain ASCII, like "<" and "
", but only in "appending" parse, and only if there was a parse with
"document.write"

Even putting just 'document.write()' on its own in the template stuffs it
up!

Thanks for you time, though,

--

:D_ima Dima Nemchenko <Dima.Nemchenko <email protected>>

"Open source code is like lobster--most people who haven't tried it don't like the way it looks. But those who try it, love it."

--------------------------------------------------------------------- To unsubscribe, e-mail: phplib-unsubscribe <email protected> For additional commands, e-mail: phplib-help <email protected>