我正在使用带有mailer扩展的Radiant在我的网站上提供一个联系人表单。
我想在发送电子邮件后显示一条漂亮的“您的电子邮件已成功发送”的消息。
然而,Radiant似乎只允许在其配置中重定向。不是为了定义闪光消息。
你知道一种通过radiant mailer扩展来定义flash消息的方法吗?
发布于 2009-10-14 06:25:12
好了,我一直在挖掘并解决以下问题:
发送电子邮件后,重定向的页面具有锚点#邮件程序。因此,使用一点javascript,我检测到该锚的存在,并显示“感谢您的电子邮件”消息。
下面是我的代码(使用JQuery)
<script type="text/javascript">
$(document).ready(function() {
$('#flash').hide();
if (window.location.href.match(/\#mailer/)) {
$('#flash').html('Enter the message here');
$('#flash').fadeIn(3000);
}
});
</script>
<div class="flash"></div>https://stackoverflow.com/questions/1559547
复制相似问题