Custom Button for Open Alert me Page in Model Popup in Java script

  1. <table>  
  2.   
  3.     <tr>  
  4.   
  5.         <td>  
  6.             <button id="setAlert" type="button" onclick='AlertMeDialog()'>Set Alert</button>  
  7.         </td>  
  8.   
  9.         <td>  
  10.             <button id="manageAlert" type="button" onclick='test()'>Manage My Alerts</button>  
  11.         </td>  
  12.   
  13.     </tr>  
  14.   
  15. </table>  
  16.   
  17. <script type="text/javascript">  
  18.     function AlertMeDialog() {  
  19.   
  20.         var options = {  
  21.   
  22.             url: '/_layouts/SubNew.aspx?List={8cf4def7-cfcf-4143-be3b-93021692c342}',  
  23.   
  24.             title: 'Set alert on this list',  
  25.   
  26.             allowMaximize: false,  
  27.   
  28.             showClose: true  
  29.   
  30.         };  
  31.   
  32.         SP.SOD.execute('sp.ui.dialog.js''SP.UI.ModalDialog.showModalDialog', options);  
  33.   
  34.     }  
  35.   
  36.     function test()  
  37.   
  38.     {  
  39.   
  40.         window.open('/_layouts/15/start.aspx#/_layouts/15/MySubs.aspx');  
  41.   
  42.     }  
  43. </script>