在jquery里面的CSS中的警报框
我想if block in jquery
中的if block in jquery
显示一个错误警告框但是错误即将到来。 有人可以帮我吗 我在这个网站上找到了警告框,但在这种情况下,我必须点击错误消息弹出警报才能看到警报,但是如何在我的jquery if part
添加该错误消息弹出警报警报, jquery if part
没有点击该警报框将apear?
$("#textbox").keyup(function () { $.getJSON('check.jsp', { textboxname: this.value },function(data){ if(data.isTrue){ $("#textbox").val(''); //clear the text box and show that Error Message Popup Alert } else{ //do something } }); });
称之为下面的代码,
$("#textbox").keyup(function () { $.getJSON('check.jsp', { textboxname: this.value },function(data){ if(data.isTrue){ $("#textbox").val(''); //clear the text box and show that Error Message Popup Alert csscody.alert(data); } else{ //do something } }); });
if(data.isTrue){ $("#textbox").val(''); //clear the text box and show that Error Message Popup Alert csscody.alert('Hello World
'); return false; }
在HEAD
部分包含以下js文件
http://csscody.com/demo/wp-content/demo/popup/js/jquery.easing.1.3.js
http://csscody.com/demo/wp-content/demo/popup/js/alertbox.js
然后在if
块内的成功处理程序中提醒消息
$("#textbox").keyup(function () { $.getJSON('check.jsp', { textboxname: this.value },function(data){ if(data.isTrue){ csscody.alert("user name already exists"); $("#textbox").val(''); //clear the text box and show that Error Message Popup Alert } else{ //do something } }); });
DEMO