Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in order to disable "prevent this page from creating additional dialogues" my alert box is over written by jquery .

whenever it alerts javascript execution should stop and should continue after we click ok.

but its not happening now instead java script is getting executed before we click ok.



XML
<script src="../js/jquery-ui.js" type="text/javascript"></script>
      <link href="../css/jquery-ui.css" rel="stylesheet" type="text/css" />
      <script type="text/javascript">
          window.old_alert = window.alert;
          window.alert = function (message, fallback) {
              if (fallback) {
                  old_alert(message);
                  return;
              }
              $(document.createElement('div'))
      .attr({ title: '<%= Resources.LocalStrings.Alert %>', 'class': 'alert' })
      .html(message)
      .dialog({
          buttons: { '<%= Resources.LocalStrings.Ok %>': function () { $(this).dialog('close'); } },
          close: function () { $(this).remove(); },
          draggable: true,
          modal: true,
          resizable: true,
          width: '250px'
      });
          };
      </script>
Posted
Updated 7-Apr-14 19:58pm
v2
Comments
Ajith K Gatty 8-Apr-14 1:49am    
Hi,
provide the script also.
Member 10690248 8-Apr-14 1:56am    
ok
Member 10690248 8-Apr-14 1:57am    
<script src="../js/jquery-ui.js" type="text/javascript"></script>
<link href="../css/jquery-ui.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
window.old_alert = window.alert;
window.alert = function (message, fallback) {
if (fallback) {
old_alert(message);
return;
}
$(document.createElement('div'))
.attr({ title: '<%= Resources.LocalStrings.Alert %>', 'class': 'alert' })
.html(message)
.dialog({
buttons: { '<%= Resources.LocalStrings.Ok %>': function () { $(this).dialog('close'); } },
close: function () { $(this).remove(); },
draggable: true,
modal: true,
resizable: true,
width: '250px'
});
};
</script>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900