Hi,
Just lose the ?php ? tags and you're good to go. ;)
You're trying to run javascript code in the PHP interpreter, which
isn't going to work.
All you have to do is replace your code with:
div id=mutsu class=apple/div
if( $('mutsu').hasClassName(apple) ) {
alert(div has CSS apple
On 01/15/2010 09:20 PM, Tiago Nunes wrote:
You're confusing PHP code with Javascript code, and that's not good.
Thanks Tiago, it's true..
Anywy im trying this:
?php echo javascript_tag(
if($('mutsu').hasClassName(apple)) {
alert(div has CSS apple class.);
}
) ?
And it doesn't
El 15/01/2010 18:10, Javier Garcia escribió:
Thanks Tiago, it's true..
Anywy im trying this:
?php echo javascript_tag(
if($('mutsu').hasClassName(apple)) {
alert(div has CSS apple class.);
}
) ?
And it doesn't work...
No problem with ordinary code:
script type=text/javascript
In my last email I forgot the opening and closing javascript tags
(or the symfony helper), but Rodrigo already gave you the correct
answer.
Try:
?php echo javascript_tag(
if($('mutsu').hasClassName('apple')) {
alert('div has CSS apple class.');
}
) ?
--
Tiago