弹出ajax成功

I have this modal pop up when a link is clicked. It has a text area and 2 buttons: Send and cancel

   <a href="#message" style="text-decoration:none" class="common2 simple3" >Message</a>
        <div id="message" class="modalDialog">
                <div>
                    <!---<a href="#close" title="Close" class="close">X</a>--->
                    <h3>Create A Message</h3>


                    <textarea  id = 'msgContent' cols="48" rows="10" ></textarea>
                    <br>
                    <div id="create_btn">
                        <a href="#" id = 'send' class="common simple2" style='margin-left:50px;text-decoration: none;'>Send</a>
                    </div>
                    <div id="cancel_btn">
                        <a href="#close" class="common simple2" style='margin-left:40px;text-decoration: none;'>cancel</a>
                    </div>
                    <br>
                    <br>
                </div>
        </div>
        <div id="success" class="modalDialog">
                <div>
                    <h3>Message sent</h3>
                    <div id="cancel_btn">
                        <a href="#close" class="common simple2" style='margin-left:40px;text-decoration: none;'>OK</a>
                    </div>
                </div>
        </div>

and i have this code in ajax success when the send button is clicked

  success: function(result)
                        {                                           

                            if (result == true)
                            $( "#success" ).dialog( "" );

                        } 

I am working on showing another pop up when the ajax is successful. But I have no idea how to call

  <div id="success" class="modalDialog">     

What you do is check if ajax call is success by keeping an alert in it.

success: function(result){                                           
      if (result == true)
        alert('working');
      else 
        alert('not working');

}

if your alert i 'working' then check if you are including jqueryui https://jqueryui.com/dialog/

dialog() is a jquery ui function not a javascript predefine function.