0

I want to hide the alert box. Alert box at last line pops up first, after that when ajax call completes other alert box in if condition pops up, which pops up below the first one.

I want to hide the first alert box when second one pops up.

     var xmlhttp;    
     if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
      } else {// code for IE6, IE5
         xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
      xmlhttp.onreadystatechange=function() {
         if (xmlhttp.readyState==4) {
            if(xmlhttp.status==200) {               
               alert(getLocalizedString("partialExportFCdata_ui.msg3");
            }else{
               alert(getLocalizedString("partialExportFCdata_ui.msg4");
            }
         }
         var obj = document.getElementById("ChkBoxHeader");
         checkAll(false, obj.name);
      }
      xmlhttp.open("POST","FCTagService?    htmlaction=updateTags&records="+sb.toString()+"&containsid="+containsid+"&catalogIdStr="+catalogIdStr, true);
      xmlhttp.send();
      alert(getLocalizedString("partialExportFCdata_ui.msg7"); //Last alert box
nborpe
  • 189
  • 1
  • 3
  • 13

2 Answers2

3

You cannot. This is browser specific and so you cannot control it. You can simply force it to show.

Andrey Popov
  • 7,362
  • 4
  • 38
  • 58
1

Browser's build in Popup messages are not good to use in such context, you should make use of some jquery component for doing this. Alert dialog box should mainly used for debugging purpose.

Akshay Khale
  • 8,151
  • 8
  • 50
  • 58