- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我编写了以下代码作为我网站用户注册过程的一部分。显然,一旦用户填写了他们的电子邮件并点击提交,表单数据就会通过以下方式发送:
<?php
if(isset($_POST['email'])){
$email_from = $_POST['email'];
function died($error) {
echo $error;
die();
}
if(!isset($_POST['email'])) {
died($error);
}
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= ' <script type="text/javascript">
alert("The email address you entered does not appear to be valid");
window.location = "http://www.domain.com/";
</script> ' ;
}
if(strlen($error_message) > 0) {
died($error_message);
}
etc, etc, etc....
我真的很感激能得到一些帮助的是这段脚本:
$error_message .= ' <script type="text/javascript">
alert("The email address you entered does not appear to be valid");
window.location = "http://www.domain.com/";
</script> ' ;
}
如何创建一个在 html 页面上淡入(并在点击时淡出)的错误消息,而不是在重定向到 html 页面之前在空白的白色 php 页面前面发出 js 警报?
谢谢!
最佳答案
<span class="fadeInMessage" style="display:none;">"The email address you entered does not appear to be valid"</span>
这将从不可见开始。然后你会写下面的代码:
$(function(){
$('.fadeInMessage').fadeIn();
});
关于php - 自定义 php 错误信息 fadein,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12501026/
我正在努力编写我的第一个 jQuery 脚本。我的页面上有一个 DIV,该 DIV 设置为通过 CSS 隐藏。然后,我运行这个脚本以使其淡入、淡出,然后再次淡入: (function($) {
我刚刚学习了一些 jQUery,以便在我为酒店创建的网站上建立一个基本的图片库,但目前还没有计划。我明白了,所以箭头会在图像中循环(还没有动画),但我决定箭头应该在图像悬停时淡入,而不是淡出,但这不知
我有一个具有不同模块的交互式表单系统,其中每个模块的表单包含在不同的 div 元素内。当我从一个模块更改为另一个模块时,我经常这样做: $('#module_1').hide(); $('#modul
我想在滚动页面时淡入我的标题。这是我到目前为止所得到的,除了 .fadeIn() 之外一切正常。 $(document).scroll(function() { if( $(this).scr
我有一个 jquery 错误,我已经找了好几个小时了,我不知道出了什么问题......我有这段代码: $(document).ready(function(){ $('#ulPhotos a
我试图搜索并查看是否在此下方列出了任何内容,但我什么也没看到。我有一个使用 Isotope 布局的图库,它工作正常,但是在页面加载时,图库中的图像显示在页面中间,然后一旦加载就跳转到各自的位置。 我试
如果我执行更改表格尺寸的 fadeIn(),Firefox 会剪切新显示行的背景。 如果我在远离标签的地方单击焦点,然后单击返回,背景将恢复。 Chrome 中没有裁剪问题。我在 Firefox 26
现在,当我淡入叠加层 div 时,它会自动设置为 display: block;。但我希望它是 display: table。有没有像 fadein() 这样的 jQuery 函数可以做到这一点? j
我有这个函数,非常适合延迟加载。 panel.find('img[data-src]').each(function(){ element = $(this);
有人可以告诉我我做错了什么吗: 风格: .warning{border: 1px solid #F0AAAA; background:#FFBABA; color: #C90000;} 标记: A
当我单击切换按钮时,它会将元素的样式属性从“不显示”更改为“阻止”。现在,当发生这种情况时,我想为菜单的左侧位置设置动画。我有这样的代码,但工作有问题,而且,当它应该返回到右侧时,它出现在左侧.. v
我有这段代码,可以在一定的延迟后切换图像的不透明度: $(".pattern-overlay").css("background","black").delay(2000).queue(functio
我对 jQuery 很陌生,所以请耐心等待。 我想逐步淡入列表。但我的功能出了什么问题。请问有人可以帮助我吗? 非常感谢! 编辑:我检查了所有内容,没有发现任何错误。主体具有所需的类。 $(".sid
我希望有人能帮助我。我遇到以下问题: http://jsfiddle.net/zhPAF/ 标记: About Us
这是我的代码..我想要应用淡入淡出,我按照下面的方式做了,但淡入淡出没有应用 $(document).ready(function(){ var i = 1; $
我使用 jquery 加载和淡入目标 div 中的内容。这很好用,我喜欢它看起来很整洁。但是,如果您单击链接多次(快速)淡入内容,则内容似乎不会完全不透明。因此,如果我按链接两次(再次非常快),它只能
非常简单的 jQuery 元素作为实践。我已经设置了一个按钮(#btn),我想看看当我单击该按钮时是否可以淡入 Div。我设置了一个 Fiddle,代码本身有什么问题吗? 链接到JsFiddle .
我正在开发一个网站,我希望每次打开网页时都会淡入文本,所以我做了这样的事情: $(document).ready(function() { $('#title').fadeIn(100); }
请有人让我摆脱痛苦......我已经投入了一个又一个小时...... 我已经(这是缩写)创建了一个函数,该函数使用 append 将框添加到页面。问题是一旦添加了它们,淡入功能就不起作用了。 但是,如
与我在这里看到的其他帖子不同,我使用 jQuery fadeIn 来处理可变文本而不是图像。我看到它逐渐褪色,最后一个脉冲变成全彩。我希望它能逐渐淡出。我已将其发布在 jsFiddle 上:http:
我是一名优秀的程序员,十分优秀!