jQuery的Ajax请求我与一个消息可以创建div成功的功能...但它似乎并没有显示出来....jQuery的AJAX功能的成功显示信息
success: function(data) {
$(function() {
$('<div id="alert">Successfully Updated</div>');
var $alert = $('#alert');
if ($alert.length) {
var alerttimer = window.setTimeout(function() {
$alert.trigger('click');
}, 3000);
$alert.animate({ height: $alert.css('line-height') || '50px' }, 200).click(function() {
window.clearTimeout(alerttimer);
$alert.animate({ height: '0' }, 200);
});
}
});
CSS:
#alert
{
overflow: hidden;
width: 100%;
text-align: center;
position: absolute;
top: 0;
left: 0;
background-color: #FF0000;
height: 0;
color: #FFFFFF;
font: 20px/40px arial, sans-serif;
opacity: .9;
}
var alert = $('
@joe你的回答工作... – 2010-06-22 09:57:58
由于某种原因,回调是否包含“在DOM准备好”调用? – 2010-06-22 10:05:11