PHP打开LAYER弹窗后,需要跳转页面,开始在PHP中做跳转,结果弹窗还没有打开就已经跳转。需要这样时,把跳转放到LAYER里执行。
if(count($coursedata) == 0 && $courseid > ''){
echo "<script type='text/javascript' >layeralert('无效的单号','vacheck.php');</script>";
}
function layeralert(msg,url){
layer.msg(msg, {
time: 3000,
end: function(){
window.location.href = url;
}
});
}