can you do a jquery mobile popup on ajax response event?
===

Was hoping to use the popup and I am pretty sure I am trying to use it incorrectly.  Any ideas on how this should work?  Can you use the popup in this manner?


<div id="notification" data-role="popup"></div>


    <script>

    function onSuccess(data, status)
    {
        data = $.trim(data);
        $("#notification").text(data);
    }
  
    function onError(data, status)
    {
        data = $.trim(data);
        //$("#notification").text(data);
        $("#notification").popup(data);        }        
  
    $(document).ready(function() {
        $("#submit").click(function(){
 
            var formData = $("#callAjaxForm").serialize();
  
            $.ajax({
                type: "POST",
                url: "sendmsg.php",
                cache: false,
                data: formData,
                success: onSuccess,
                error: onError
            });
  
            return false;
        });
    });
    </script>