When a jquery-mobile popup(Dialog) is opened, when clicking a command link inside the dialog, ajax request will update the dialog with the same popup markup with different header and content.
$(PrimeFaces.escapeClientId(id)).replaceWith(content);
id is popupDialog, and content is
<div id="popupDialog"
data-role="popup"
data-overlay-theme="b"
data-theme="b"
data-dismissible="false">
....
</div>
But got error.
Uncaught NotFoundError: Failed to execute 'replaceChild' on 'Node': The node to be replaced is not a child of this node.
It is a normal ajax update DOM element. What might be the cause? Thanks for any insight.