我想在点击'更新'按钮之后显示5秒钟的警报消息,然后执行更新操作。显示5秒钟的警报消息
my $cFunction = qq{
\$(document).ready(function(){
var w;
function closeWindow(){
setTimeout("w.close();", 3000);
}
function createWindow(){
//create the popup window.
w=window.open("","",'width=200,height=100');
// put something into the popup window
try{w.document.write('<html><head></head><body><p>Updating...</p></body> <html>')}catch(err){
//handle error here
}
closeWindow();
}
}
};
print $q->script($cFunction);
<--html form--->
$cInput_form .= $q->image_button({-src => '/media/images/save_1.png',-class => 'upd',-title => 'update', -name =>'Update', -value => $row_id, -onclick => 'createWindow()'});
print $q->fieldset ({-class => "ui-widget ui-widget-content"}, $cInput_form);
但这是行不通的。为什么?
请试试这个:'setTimeout(timeout_trigger,5000);' – Cherniv
你想让警报消息停留5秒,然后隐藏自己吗? – higuaro
它仍然不显示消息 – Armida