php pop Case

? < PHP
 // pop-up dialog box and return to the original page 
echo "<Script Language = \" JavaScript \ "> \ r \ the n-" ;
 echo "Alert (\" Hello \ "); \ r \ the n-" ;
 / / historical returns; 
echo "history.back (); \ r \ the n-" ;
 echo "</ Script>" ;
 Exit ;
 ?>
<-! Php pop, is the use of JavaScript -> 

<? PHP
 echo "<Script Language = \" JavaScript \ "> Alert (\" Hello \ "); </ Script>" ;
 ?>
<!-- php弹窗,是利用javascript -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
<script>
    function del(){ 
    if(confirm("确定要删除吗?")){ 
    alert('删除成功!'); 
    return true; 
    }else{ 
    return false; 
    } 
    } 
</script>
    
</body>
</html>


<?php
    $button=<<<STR
    <button onclick="del()">删除</button>
STR;
    echo $button;
?>

 

Guess you like

Origin www.cnblogs.com/xiaowie/p/12009245.html
pop