Escape <?php ... ?> on javascript file -
i'm busy doing server side , client side validation magento. validation works fine on server side (php)
on client side using javasrcript.
when started on this. had javascript embedded on phtml file , working expected.
because using magento decided inject javascript file via page.xml
when added javascript code instead of getting message pulled php is.
here javascript:
function defaultaddresserrorchangenotallowedmessage() { alert("<?php echo mage::helper('invent_general')->getdefaultaddresserrorchangenotallowedmessage();?>"); return; }
i run when user hit onclick point function defaultaddresserrorchangenotallowedmessage()
, the
<?php echo mage::helper('invent_general')->getdefaultaddresserrorchangenotallowedmessage();?>
will populated is.
but when embed directly phtml file pull correct message.
i there way javasrcipt can use escape php , correct message pulled config.xml
php rendered server side only. if need "inject" php specific values javascript, either need render actual value part of output of php script, or need take new roundtrip server, using ajax.
Comments
Post a Comment