这里我想通过tostr显示validation_error消息,以便我像这样编写我的代码
<script type="text/javascript">
toastr.options = {
"closeButton": true,
//"allowHtml": true,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-bottom-right",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}
</script>
<?php
if (!empty($message)) {?>
<script>
toastr.error('<?php echo $message;?>', 'Inconceivable!', {timeOut: 5000})
</script>
<?php }?>
我的$ message包含这样的字符串
'<p>The New Password field does not match the Confirm New Password field.</p>'
请帮我解决。