write php inside javascript alert -


i write php inside js in following way

alert(<?php echo __("error-login") ?>); 

echo__("error-login") correlates xml translate in 2 languages ​​with symfony, not work.

how fix this?

you missing quotes in alert() call.

alert('<?php echo __("error-login") ?>');  

Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -