JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://code.jquery.com/ui/jquery-ui-git.css">
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<form id="frm">
    <input type="button" id="test" value="test" />
</form>

JavaScript

$("#test").click(function(){
    if($('#dialog').length > 0)
    {
        //when you call this by clicking 2nd time to test 
        //overlay fails
        $('#dialog').dialog('open');
    } else {
        $('#frm').append('<div id="dialog"></div>');
        //Here you need to load a local page with a document ready function inside and a call to closeModal()
        $('#dialog').load('http://4chan.org/b/');
        
        $('#dialog').dialog({
            modal: true,
            height: 600,
            width: 800,
            parentTo: '#frm'
        });
    }
});

function closeModal()
{
    $('#dialog').close();
}